#----------------------------------*-sh-*--------------------------------------
# =========                 |
# \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
#  \\    /   O peration     | Website:  https://openfoam.org
#   \\  /    A nd           | Copyright (C) 2017-2025 OpenFOAM Foundation
#    \\/     M anipulation  |
#------------------------------------------------------------------------------
# License
#     This file is part of OpenFOAM.
#
#     OpenFOAM is free software: you can redistribute it and/or modify it
#     under the terms of the GNU General Public License as published by
#     the Free Software Foundation, either version 3 of the License, or
#     (at your option) any later version.
#
#     OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
#     ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
#     FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
#     for more details.
#
#     You should have received a copy of the GNU General Public License
#     along with OpenFOAM.  If not, see <http://www.gnu.org/licenses/>.
#
# File
#     etc/config.sh/bash_completion
#
# Description
#     Bash [TAB] completion file from OpenFOAM
#     Sourced from /etc/bashrc
#
#------------------------------------------------------------------------------
# shellcheck disable=SC2155,SC2207,SC2086

_region ()
{
    find . -maxdepth 3 -name polyMesh -type d 2> /dev/null | \
        awk -F '/' '{print $(NF-1)}' | \
        grep -v constant | \
        sort -u | xargs
}

_mesh ()
{
    for d in constant system
    do
        find "$d/meshes" -mindepth 1 -maxdepth 1 -type d 2> /dev/null | \
        awk -F '/' '{print $(NF)}'
    done | sort -u | xargs
}

_solver ()
{
    foamToC -table solver | sed '1,/Contents/d' | awk '{print $1}' | xargs
}

_table ()
{
    [ -z "${1// }" ] && \
        foamToC -tables | \
        sed '1,/Run-time/d' | \
        sed 's/[[:space:]]\{4\}//' | grep -v ' ' && exit 0
    foamToC -tables | sed '1,/Run-time/d' | tr -d " "
}

_func ()
{
    foamPostProcess -list | sed -n '/^(/,/^)/p' | grep -v '[()]'
}

_optSet () {
    _used="$1"
    _opts="$2"

    for _o in ${_opts//-/\\-}
    do
        echo "$_used" | grep -wq "$_o" && return 0
    done

    return 1
}

_removeOpts () {
    _opts="$1"
    _removes="$2"

    for _r in ${_removes//-/\\-}
    do
        _opts="${_opts/$_r/}"
    done

    echo "$_opts"
}

_infoArgs ()
{
    foamToC -all | \
       grep -wx '[^ _]* [^ ]*.so' | \
       awk '{print $1}' | \
       tr '<>,' '\n' | \
       sort -u | \
       xargs
}

_findArgs () {
    _dir="$1"

    [ -d "$_dir" ] || return 1

    _name="*"
    echo "$_dir" | grep -wqE "^($FOAM_SRC|$FOAM_APP)" && _name="*.[CHL]"

    find "$_dir" -name "$_name" -type f | \
        awk -F/ '{print $NF}' | \
        sort -u | \
        xargs
}

_unitArgs ()
{
    _opts="-help"

    # If '-dimension' is not selected, it is always an option
    echo "$@" | grep -q -- "-d" || _opts="$_opts -dimension"

    # If '-all' or '-list' is selected, the only other possible option is '-dimension'
    echo "$@" | grep -q -- "-[al]" && echo "$_opts" | xargs -n 1 | sort && return 0

    # If '-all' or '-list' are not selected, they are options
    _opts="$_opts -all -list"

    echo "$@" | grep -q -- "-d" && _args="-d"
    _opts="$_opts $(foamUnits -list $_args | xargs -n 1 | grep '\[' | tr -d '\[\]')"
    echo "$_opts" | xargs -n 1 | sort
}

_adiabaticFlameT_ ()
{
    local cur="${COMP_WORDS[COMP_CWORD]}"
    local prev="${COMP_WORDS[COMP_CWORD-1]}"
    local line=${COMP_LINE}
    local used=$(echo "$line" | grep -oE "\-[a-zA-Z]+ ")

    opts="-doc -help -srcDoc"
    for o in $used ; do opts="${opts/$o/}" ; done
    extra=""

    [ "$COMP_CWORD" = 1 ] || \
    case "$prev" in
       *) ;;
    esac
    COMPREPLY=( $(compgen -W "${opts}" $extra -- ${cur}) )
}
complete -o filenames -o nospace -F _adiabaticFlameT_ adiabaticFlameT

_adjointShapeOptimisationFoam_ ()
{
    local cur="${COMP_WORDS[COMP_CWORD]}"
    local prev="${COMP_WORDS[COMP_CWORD-1]}"
    local line=${COMP_LINE}
    local used=$(echo "$line" | grep -oE "\-[a-zA-Z]+ ")

    opts="-case -doc -fileHandler -help -hostRoots -libs -noFunctionObjects -parallel -postProcess -roots -srcDoc"
    for o in $used ; do opts="${opts/$o/}" ; done
    extra=""

    [ "$COMP_CWORD" = 1 ] || \
    case "$prev" in
        -case)
            opts="" ; extra="-d" ;;
        -fileHandler)
            opts="uncollated collated masterUncollated" ; extra="" ;;
        -hostRoots|-libs|-roots)
            opts="" ; extra="" ;;
       *) ;;
    esac
    COMPREPLY=( $(compgen -W "${opts}" $extra -- ${cur}) )
}
complete -o filenames -o nospace -F _adjointShapeOptimisationFoam_ adjointShapeOptimisationFoam

_ansysToFoam_ ()
{
    local cur="${COMP_WORDS[COMP_CWORD]}"
    local prev="${COMP_WORDS[COMP_CWORD-1]}"
    local line=${COMP_LINE}
    local used=$(echo "$line" | grep -oE "\-[a-zA-Z]+ ")

    opts="-case -doc -fileHandler -help -libs -noFunctionObjects -scale -srcDoc"
    for o in $used ; do opts="${opts/$o/}" ; done
    extra="-d -f"

    [ "$COMP_CWORD" = 1 ] || \
    case "$prev" in
        -case)
            opts="" ; extra="-d" ;;
        -fileHandler)
            opts="uncollated collated masterUncollated" ; extra="" ;;
        -libs|-scale)
            opts="" ; extra="" ;;
       -*) ;;
        *)
            case "${COMP_WORDS[COMP_CWORD-2]}" in
                -libs|-scale|-case|-fileHandler) ;;
                *) opts=""; extra="" ;;
            esac
            ;;
    esac
    COMPREPLY=( $(compgen -W "${opts}" $extra -- ${cur}) )
}
complete -o filenames -o nospace -F _ansysToFoam_ ansysToFoam

_applyBoundaryLayer_ ()
{
    local cur="${COMP_WORDS[COMP_CWORD]}"
    local prev="${COMP_WORDS[COMP_CWORD-1]}"
    local line=${COMP_LINE}
    local used=$(echo "$line" | grep -oE "\-[a-zA-Z]+ ")

    opts="-case -Cbl -doc -fileHandler -help -hostRoots -libs -noFunctionObjects -parallel -roots -srcDoc -writenut -ybl"
    for o in $used ; do opts="${opts/$o/}" ; done
    extra=""

    [ "$COMP_CWORD" = 1 ] || \
    case "$prev" in
        -case)
            opts="" ; extra="-d" ;;
        -fileHandler)
            opts="uncollated collated masterUncollated" ; extra="" ;;
        -Cbl|-hostRoots|-libs|-roots|-ybl)
            opts="" ; extra="" ;;
       *) ;;
    esac
    COMPREPLY=( $(compgen -W "${opts}" $extra -- ${cur}) )
}
complete -o filenames -o nospace -F _applyBoundaryLayer_ applyBoundaryLayer

_autoPatch_ ()
{
    local cur="${COMP_WORDS[COMP_CWORD]}"
    local prev="${COMP_WORDS[COMP_CWORD-1]}"
    local line=${COMP_LINE}
    local used=$(echo "$line" | grep -oE "\-[a-zA-Z]+ ")

    opts="-case -doc -fileHandler -help -libs -noFunctionObjects -noOverwrite -overwrite -srcDoc"
    for o in $used ; do opts="${opts/$o/}" ; done
    extra=""

    [ "$COMP_CWORD" = 1 ] || \
    case "$prev" in
        -case)
            opts="" ; extra="-d" ;;
        -fileHandler)
            opts="uncollated collated masterUncollated" ; extra="" ;;
        -libs)
            opts="" ; extra="" ;;
       *) ;;
    esac
    COMPREPLY=( $(compgen -W "${opts}" $extra -- ${cur}) )
}
complete -o filenames -o nospace -F _autoPatch_ autoPatch

_blockMesh_ ()
{
    local cur="${COMP_WORDS[COMP_CWORD]}"
    local prev="${COMP_WORDS[COMP_CWORD-1]}"
    local line=${COMP_LINE}
    local used=$(echo "$line" | grep -oE "\-[a-zA-Z]+ ")

    opts="-blockTopology -case -dict -doc -fileHandler -help -libs -mesh -noClean -region -srcDoc"
    for o in $used ; do opts="${opts/$o/}" ; done
    extra=""

    [ "$COMP_CWORD" = 1 ] || \
    case "$prev" in
        -case)
            opts="" ; extra="-d" ;;
        -dict)
            opts="" ; extra="-d -f" ;;
        -fileHandler)
            opts="uncollated collated masterUncollated" ; extra="" ;;
        -libs)
            opts="" ; extra="" ;;
        -mesh) opts="$(_mesh ${cur})" ;;
        -region) opts="$(_region ${cur})" ;;
       *) ;;
    esac
    COMPREPLY=( $(compgen -W "${opts}" $extra -- ${cur}) )
}
complete -o filenames -o nospace -F _blockMesh_ blockMesh

_boundaryFoam_ ()
{
    local cur="${COMP_WORDS[COMP_CWORD]}"
    local prev="${COMP_WORDS[COMP_CWORD-1]}"
    local line=${COMP_LINE}
    local used=$(echo "$line" | grep -oE "\-[a-zA-Z]+ ")

    opts="-case -doc -fileHandler -help -libs -noFunctionObjects -srcDoc"
    for o in $used ; do opts="${opts/$o/}" ; done
    extra=""

    [ "$COMP_CWORD" = 1 ] || \
    case "$prev" in
        -case)
            opts="" ; extra="-d" ;;
        -fileHandler)
            opts="uncollated collated masterUncollated" ; extra="" ;;
        -libs)
            opts="" ; extra="" ;;
       *) ;;
    esac
    COMPREPLY=( $(compgen -W "${opts}" $extra -- ${cur}) )
}
complete -o filenames -o nospace -F _boundaryFoam_ boundaryFoam

_boxTurb_ ()
{
    local cur="${COMP_WORDS[COMP_CWORD]}"
    local prev="${COMP_WORDS[COMP_CWORD-1]}"
    local line=${COMP_LINE}
    local used=$(echo "$line" | grep -oE "\-[a-zA-Z]+ ")

    opts="-case -doc -fileHandler -help -libs -noFunctionObjects -srcDoc"
    for o in $used ; do opts="${opts/$o/}" ; done
    extra=""

    [ "$COMP_CWORD" = 1 ] || \
    case "$prev" in
        -case)
            opts="" ; extra="-d" ;;
        -fileHandler)
            opts="uncollated collated masterUncollated" ; extra="" ;;
        -libs)
            opts="" ; extra="" ;;
       *) ;;
    esac
    COMPREPLY=( $(compgen -W "${opts}" $extra -- ${cur}) )
}
complete -o filenames -o nospace -F _boxTurb_ boxTurb

_cfx4ToFoam_ ()
{
    local cur="${COMP_WORDS[COMP_CWORD]}"
    local prev="${COMP_WORDS[COMP_CWORD-1]}"
    local line=${COMP_LINE}
    local used=$(echo "$line" | grep -oE "\-[a-zA-Z]+ ")

    opts="-case -doc -fileHandler -help -libs -noFunctionObjects -scale -srcDoc"
    for o in $used ; do opts="${opts/$o/}" ; done
    extra="-d -f"

    [ "$COMP_CWORD" = 1 ] || \
    case "$prev" in
        -case)
            opts="" ; extra="-d" ;;
        -fileHandler)
            opts="uncollated collated masterUncollated" ; extra="" ;;
        -libs|-scale)
            opts="" ; extra="" ;;
       -*) ;;
        *)
            case "${COMP_WORDS[COMP_CWORD-2]}" in
                -libs|-scale|-case|-fileHandler) ;;
                *) opts=""; extra="" ;;
            esac
            ;;
    esac
    COMPREPLY=( $(compgen -W "${opts}" $extra -- ${cur}) )
}
complete -o filenames -o nospace -F _cfx4ToFoam_ cfx4ToFoam

_changeDictionary_ ()
{
    local cur="${COMP_WORDS[COMP_CWORD]}"
    local prev="${COMP_WORDS[COMP_CWORD-1]}"
    local line=${COMP_LINE}
    local used=$(echo "$line" | grep -oE "\-[a-zA-Z]+ ")

    opts="-case -constant -dict -disablePatchGroups -doc -enableFunctionEntries -fileHandler -help -hostRoots -instance -latestTime -libs -literalRE -mesh -noFunctionObjects -noZero -parallel -region -roots -srcDoc -subDict -time"
    for o in $used ; do opts="${opts/$o/}" ; done
    extra=""

    [ "$COMP_CWORD" = 1 ] || \
    case "$prev" in
        -case)
            opts="" ; extra="-d" ;;
        -dict)
            opts="" ; extra="-d -f" ;;
        -fileHandler)
            opts="uncollated collated masterUncollated" ; extra="" ;;
        -time)
            opts="$(foamListTimes -withZero 2> /dev/null)" ; extra="" ;;
        -hostRoots|-instance|-libs|-roots|-subDict)
            opts="" ; extra="" ;;
        -mesh) opts="$(_mesh ${cur})" ;;
        -region) opts="$(_region ${cur})" ;;
       *) ;;
    esac
    COMPREPLY=( $(compgen -W "${opts}" $extra -- ${cur}) )
}
complete -o filenames -o nospace -F _changeDictionary_ changeDictionary

_checkMesh_ ()
{
    local cur="${COMP_WORDS[COMP_CWORD]}"
    local prev="${COMP_WORDS[COMP_CWORD-1]}"
    local line=${COMP_LINE}
    local used=$(echo "$line" | grep -oE "\-[a-zA-Z]+ ")

    opts="-allGeometry -allTopology -case -constant -doc -fileHandler -help -hostRoots -latestTime -libs -mesh -meshQuality -noFunctionObjects -nonOrthThreshold -noTopology -noZero -parallel -region -roots -setFormat -skewThreshold -srcDoc -surfaceFormat -time -writeSets -writeSurfaces"
    for o in $used ; do opts="${opts/$o/}" ; done
    extra=""

    [ "$COMP_CWORD" = 1 ] || \
    case "$prev" in
        -case)
            opts="" ; extra="-d" ;;
        -fileHandler)
            opts="uncollated collated masterUncollated" ; extra="" ;;
        -time)
            opts="$(foamListTimes -withZero 2> /dev/null)" ; extra="" ;;
        -hostRoots|-libs|-nonOrthThreshold|-roots|-setFormat|-skewThreshold|-surfaceFormat)
            opts="" ; extra="" ;;
        -mesh) opts="$(_mesh ${cur})" ;;
        -region) opts="$(_region ${cur})" ;;
       *) ;;
    esac
    COMPREPLY=( $(compgen -W "${opts}" $extra -- ${cur}) )
}
complete -o filenames -o nospace -F _checkMesh_ checkMesh

_chemFoam_ ()
{
    local cur="${COMP_WORDS[COMP_CWORD]}"
    local prev="${COMP_WORDS[COMP_CWORD-1]}"
    local line=${COMP_LINE}
    local used=$(echo "$line" | grep -oE "\-[a-zA-Z]+ ")

    opts="-case -doc -fileHandler -help -libs -noFunctionObjects -postProcess -srcDoc"
    for o in $used ; do opts="${opts/$o/}" ; done
    extra=""

    [ "$COMP_CWORD" = 1 ] || \
    case "$prev" in
        -case)
            opts="" ; extra="-d" ;;
        -fileHandler)
            opts="uncollated collated masterUncollated" ; extra="" ;;
        -libs)
            opts="" ; extra="" ;;
       *) ;;
    esac
    COMPREPLY=( $(compgen -W "${opts}" $extra -- ${cur}) )
}
complete -o filenames -o nospace -F _chemFoam_ chemFoam

_chemkinToFoam_ ()
{
    local cur="${COMP_WORDS[COMP_CWORD]}"
    local prev="${COMP_WORDS[COMP_CWORD-1]}"
    local line=${COMP_LINE}
    local used=$(echo "$line" | grep -oE "\-[a-zA-Z]+ ")

    opts="-doc -help -newFormat -precision -srcDoc"
    for o in $used ; do opts="${opts/$o/}" ; done
    extra="-d -f"

    [ "$COMP_CWORD" = 1 ] || \
    case "$prev" in
        -precision)
            opts="" ; extra="" ;;
       -*) ;;
        *) opts="";;
    esac
    COMPREPLY=( $(compgen -W "${opts}" $extra -- ${cur}) )
}
complete -o filenames -o nospace -F _chemkinToFoam_ chemkinToFoam

_collapseEdges_ ()
{
    local cur="${COMP_WORDS[COMP_CWORD]}"
    local prev="${COMP_WORDS[COMP_CWORD-1]}"
    local line=${COMP_LINE}
    local used=$(echo "$line" | grep -oE "\-[a-zA-Z]+ ")

    opts="-case -collapseFaces -collapseFaceSet -constant -dict -doc -fileHandler -help -hostRoots -latestTime -libs -mesh -noFunctionObjects -noOverwrite -noZero -overwrite -parallel -region -roots -srcDoc -time"
    for o in $used ; do opts="${opts/$o/}" ; done
    extra=""

    [ "$COMP_CWORD" = 1 ] || \
    case "$prev" in
        -case)
            opts="" ; extra="-d" ;;
        -dict)
            opts="" ; extra="-d -f" ;;
        -fileHandler)
            opts="uncollated collated masterUncollated" ; extra="" ;;
        -time)
            opts="$(foamListTimes -withZero 2> /dev/null)" ; extra="" ;;
        -collapseFaceSet|-hostRoots|-libs|-roots)
            opts="" ; extra="" ;;
        -mesh) opts="$(_mesh ${cur})" ;;
        -region) opts="$(_region ${cur})" ;;
       *) ;;
    esac
    COMPREPLY=( $(compgen -W "${opts}" $extra -- ${cur}) )
}
complete -o filenames -o nospace -F _collapseEdges_ collapseEdges

_combinePatchFaces_ ()
{
    local cur="${COMP_WORDS[COMP_CWORD]}"
    local prev="${COMP_WORDS[COMP_CWORD-1]}"
    local line=${COMP_LINE}
    local used=$(echo "$line" | grep -oE "\-[a-zA-Z]+ ")

    opts="-case -concaveAngle -doc -fileHandler -help -hostRoots -libs -meshQuality -noFunctionObjects -noOverwrite -overwrite -parallel -roots -srcDoc"
    for o in $used ; do opts="${opts/$o/}" ; done
    extra=""

    [ "$COMP_CWORD" = 1 ] || \
    case "$prev" in
        -case)
            opts="" ; extra="-d" ;;
        -fileHandler)
            opts="uncollated collated masterUncollated" ; extra="" ;;
        -concaveAngle|-hostRoots|-libs|-roots)
            opts="" ; extra="" ;;
       *) ;;
    esac
    COMPREPLY=( $(compgen -W "${opts}" $extra -- ${cur}) )
}
complete -o filenames -o nospace -F _combinePatchFaces_ combinePatchFaces

_createBaffles_ ()
{
    local cur="${COMP_WORDS[COMP_CWORD]}"
    local prev="${COMP_WORDS[COMP_CWORD-1]}"
    local line=${COMP_LINE}
    local used=$(echo "$line" | grep -oE "\-[a-zA-Z]+ ")

    opts="-case -dict -doc -fileHandler -help -hostRoots -libs -mesh -noFunctionObjects -noOverwrite -overwrite -parallel -region -roots -srcDoc"
    for o in $used ; do opts="${opts/$o/}" ; done
    extra=""

    [ "$COMP_CWORD" = 1 ] || \
    case "$prev" in
        -case)
            opts="" ; extra="-d" ;;
        -dict)
            opts="" ; extra="-d -f" ;;
        -fileHandler)
            opts="uncollated collated masterUncollated" ; extra="" ;;
        -hostRoots|-libs|-roots)
            opts="" ; extra="" ;;
        -mesh) opts="$(_mesh ${cur})" ;;
        -region) opts="$(_region ${cur})" ;;
       *) ;;
    esac
    COMPREPLY=( $(compgen -W "${opts}" $extra -- ${cur}) )
}
complete -o filenames -o nospace -F _createBaffles_ createBaffles

_createExternalCoupledPatchGeometry_ ()
{
    local cur="${COMP_WORDS[COMP_CWORD]}"
    local prev="${COMP_WORDS[COMP_CWORD-1]}"
    local line=${COMP_LINE}
    local used=$(echo "$line" | grep -oE "\-[a-zA-Z]+ ")

    opts="-case -doc -fileHandler -help -hostRoots -libs -mesh -noFunctionObjects -parallel -region -roots -srcDoc"
    for o in $used ; do opts="${opts/$o/}" ; done
    extra=""

    [ "$COMP_CWORD" = 1 ] || \
    case "$prev" in
        -case)
            opts="" ; extra="-d" ;;
        -fileHandler)
            opts="uncollated collated masterUncollated" ; extra="" ;;
        -hostRoots|-libs|-roots)
            opts="" ; extra="" ;;
        -mesh) opts="$(_mesh ${cur})" ;;
        -region) opts="$(_region ${cur})" ;;
       *) ;;
    esac
    COMPREPLY=( $(compgen -W "${opts}" $extra -- ${cur}) )
}
complete -o filenames -o nospace -F _createExternalCoupledPatchGeometry_ createExternalCoupledPatchGeometry

_createNonConformalCouples_ ()
{
    local cur="${COMP_WORDS[COMP_CWORD]}"
    local prev="${COMP_WORDS[COMP_CWORD-1]}"
    local line=${COMP_LINE}
    local used=$(echo "$line" | grep -oE "\-[a-zA-Z]+ ")

    opts="-case -dict -doc -fields -fileHandler -help -hostRoots -libs -mesh -noFunctionObjects -noOverwrite -overwrite -parallel -region -roots -srcDoc"
    for o in $used ; do opts="${opts/$o/}" ; done
    extra=""

    [ "$COMP_CWORD" = 1 ] || \
    case "$prev" in
        -case)
            opts="" ; extra="-d" ;;
        -dict)
            opts="" ; extra="-d -f" ;;
        -fileHandler)
            opts="uncollated collated masterUncollated" ; extra="" ;;
        -hostRoots|-libs|-roots)
            opts="" ; extra="" ;;
        -mesh) opts="$(_mesh ${cur})" ;;
        -region) opts="$(_region ${cur})" ;;
       *) ;;
    esac
    COMPREPLY=( $(compgen -W "${opts}" $extra -- ${cur}) )
}
complete -o filenames -o nospace -F _createNonConformalCouples_ createNonConformalCouples

_createPatch_ ()
{
    local cur="${COMP_WORDS[COMP_CWORD]}"
    local prev="${COMP_WORDS[COMP_CWORD-1]}"
    local line=${COMP_LINE}
    local used=$(echo "$line" | grep -oE "\-[a-zA-Z]+ ")

    opts="-case -dict -doc -fileHandler -help -hostRoots -libs -mesh -noFunctionObjects -noOverwrite -overwrite -parallel -region -roots -srcDoc"
    for o in $used ; do opts="${opts/$o/}" ; done
    extra=""

    [ "$COMP_CWORD" = 1 ] || \
    case "$prev" in
        -case)
            opts="" ; extra="-d" ;;
        -dict)
            opts="" ; extra="-d -f" ;;
        -fileHandler)
            opts="uncollated collated masterUncollated" ; extra="" ;;
        -hostRoots|-libs|-roots)
            opts="" ; extra="" ;;
        -mesh) opts="$(_mesh ${cur})" ;;
        -region) opts="$(_region ${cur})" ;;
       *) ;;
    esac
    COMPREPLY=( $(compgen -W "${opts}" $extra -- ${cur}) )
}
complete -o filenames -o nospace -F _createPatch_ createPatch

_createZones_ ()
{
    local cur="${COMP_WORDS[COMP_CWORD]}"
    local prev="${COMP_WORDS[COMP_CWORD-1]}"
    local line=${COMP_LINE}
    local used=$(echo "$line" | grep -oE "\-[a-zA-Z]+ ")

    opts="-case -clear -dict -doc -fileHandler -fvMesh -help -hostRoots -libs -mesh -noFunctionObjects -parallel -region -roots -srcDoc -zonesGenerator"
    for o in $used ; do opts="${opts/$o/}" ; done
    extra=""

    [ "$COMP_CWORD" = 1 ] || \
    case "$prev" in
        -case)
            opts="" ; extra="-d" ;;
        -dict)
            opts="" ; extra="-d -f" ;;
        -fileHandler)
            opts="uncollated collated masterUncollated" ; extra="" ;;
        -hostRoots|-libs|-roots)
            opts="" ; extra="" ;;
        -mesh) opts="$(_mesh ${cur})" ;;
        -region) opts="$(_region ${cur})" ;;
       *) ;;
    esac
    COMPREPLY=( $(compgen -W "${opts}" $extra -- ${cur}) )
}
complete -o filenames -o nospace -F _createZones_ createZones

_datToFoam_ ()
{
    local cur="${COMP_WORDS[COMP_CWORD]}"
    local prev="${COMP_WORDS[COMP_CWORD-1]}"
    local line=${COMP_LINE}
    local used=$(echo "$line" | grep -oE "\-[a-zA-Z]+ ")

    opts="-case -doc -fileHandler -help -libs -noFunctionObjects -srcDoc"
    for o in $used ; do opts="${opts/$o/}" ; done
    extra="-d -f"

    [ "$COMP_CWORD" = 1 ] || \
    case "$prev" in
        -case)
            opts="" ; extra="-d" ;;
        -fileHandler)
            opts="uncollated collated masterUncollated" ; extra="" ;;
        -libs)
            opts="" ; extra="" ;;
       -*) ;;
        *)
            case "${COMP_WORDS[COMP_CWORD-2]}" in
                -libs|-case|-fileHandler) ;;
                *) opts=""; extra="" ;;
            esac
            ;;
    esac
    COMPREPLY=( $(compgen -W "${opts}" $extra -- ${cur}) )
}
complete -o filenames -o nospace -F _datToFoam_ datToFoam

_decomposePar_ ()
{
    local cur="${COMP_WORDS[COMP_CWORD]}"
    local prev="${COMP_WORDS[COMP_CWORD-1]}"
    local line=${COMP_LINE}
    local used=$(echo "$line" | grep -oE "\-[a-zA-Z]+ ")

    opts="-allRegions -case -cellProc -constant -copyUniform -copyZero -doc -fields -fileHandler -force -help -latestTime -libs -mesh -noFields -noFunctionObjects -noSets -noZero -region -srcDoc -time"
    for o in $used ; do opts="${opts/$o/}" ; done
    extra=""

    [ "$COMP_CWORD" = 1 ] || \
    case "$prev" in
        -case)
            opts="" ; extra="-d" ;;
        -fileHandler)
            opts="uncollated collated masterUncollated" ; extra="" ;;
        -time)
            opts="$(foamListTimes -withZero 2> /dev/null)" ; extra="" ;;
        -libs)
            opts="" ; extra="" ;;
        -mesh) opts="$(_mesh ${cur})" ;;
        -region) opts="$(_region ${cur})" ;;
       *) ;;
    esac
    COMPREPLY=( $(compgen -W "${opts}" $extra -- ${cur}) )
}
complete -o filenames -o nospace -F _decomposePar_ decomposePar

_deformedGeom_ ()
{
    local cur="${COMP_WORDS[COMP_CWORD]}"
    local prev="${COMP_WORDS[COMP_CWORD-1]}"
    local line=${COMP_LINE}
    local used=$(echo "$line" | grep -oE "\-[a-zA-Z]+ ")

    opts="-case -doc -fileHandler -help -hostRoots -libs -mesh -noFunctionObjects -parallel -region -roots -srcDoc"
    for o in $used ; do opts="${opts/$o/}" ; done
    extra=""

    [ "$COMP_CWORD" = 1 ] || \
    case "$prev" in
        -case)
            opts="" ; extra="-d" ;;
        -fileHandler)
            opts="uncollated collated masterUncollated" ; extra="" ;;
        -hostRoots|-libs|-roots)
            opts="" ; extra="" ;;
        -mesh) opts="$(_mesh ${cur})" ;;
        -region) opts="$(_region ${cur})" ;;
       *) ;;
    esac
    COMPREPLY=( $(compgen -W "${opts}" $extra -- ${cur}) )
}
complete -o filenames -o nospace -F _deformedGeom_ deformedGeom

_dsmcFoam_ ()
{
    local cur="${COMP_WORDS[COMP_CWORD]}"
    local prev="${COMP_WORDS[COMP_CWORD-1]}"
    local line=${COMP_LINE}
    local used=$(echo "$line" | grep -oE "\-[a-zA-Z]+ ")

    opts="-case -doc -fileHandler -help -hostRoots -libs -noFunctionObjects -parallel -postProcess -roots -srcDoc"
    for o in $used ; do opts="${opts/$o/}" ; done
    extra=""

    [ "$COMP_CWORD" = 1 ] || \
    case "$prev" in
        -case)
            opts="" ; extra="-d" ;;
        -fileHandler)
            opts="uncollated collated masterUncollated" ; extra="" ;;
        -hostRoots|-libs|-roots)
            opts="" ; extra="" ;;
       *) ;;
    esac
    COMPREPLY=( $(compgen -W "${opts}" $extra -- ${cur}) )
}
complete -o filenames -o nospace -F _dsmcFoam_ dsmcFoam

_dsmcInitialise_ ()
{
    local cur="${COMP_WORDS[COMP_CWORD]}"
    local prev="${COMP_WORDS[COMP_CWORD-1]}"
    local line=${COMP_LINE}
    local used=$(echo "$line" | grep -oE "\-[a-zA-Z]+ ")

    opts="-case -doc -fileHandler -help -hostRoots -libs -noFunctionObjects -parallel -roots -srcDoc"
    for o in $used ; do opts="${opts/$o/}" ; done
    extra=""

    [ "$COMP_CWORD" = 1 ] || \
    case "$prev" in
        -case)
            opts="" ; extra="-d" ;;
        -fileHandler)
            opts="uncollated collated masterUncollated" ; extra="" ;;
        -hostRoots|-libs|-roots)
            opts="" ; extra="" ;;
       *) ;;
    esac
    COMPREPLY=( $(compgen -W "${opts}" $extra -- ${cur}) )
}
complete -o filenames -o nospace -F _dsmcInitialise_ dsmcInitialise

_electrostaticFoam_ ()
{
    local cur="${COMP_WORDS[COMP_CWORD]}"
    local prev="${COMP_WORDS[COMP_CWORD-1]}"
    local line=${COMP_LINE}
    local used=$(echo "$line" | grep -oE "\-[a-zA-Z]+ ")

    opts="-case -doc -fileHandler -help -hostRoots -libs -noFunctionObjects -parallel -roots -srcDoc"
    for o in $used ; do opts="${opts/$o/}" ; done
    extra=""

    [ "$COMP_CWORD" = 1 ] || \
    case "$prev" in
        -case)
            opts="" ; extra="-d" ;;
        -fileHandler)
            opts="uncollated collated masterUncollated" ; extra="" ;;
        -hostRoots|-libs|-roots)
            opts="" ; extra="" ;;
       *) ;;
    esac
    COMPREPLY=( $(compgen -W "${opts}" $extra -- ${cur}) )
}
complete -o filenames -o nospace -F _electrostaticFoam_ electrostaticFoam

_engineCompRatio_ ()
{
    local cur="${COMP_WORDS[COMP_CWORD]}"
    local prev="${COMP_WORDS[COMP_CWORD-1]}"
    local line=${COMP_LINE}
    local used=$(echo "$line" | grep -oE "\-[a-zA-Z]+ ")

    opts="-case -cellSet -cellZone -doc -fileHandler -help -hostRoots -libs -mesh -noFunctionObjects -parallel -region -roots -srcDoc"
    for o in $used ; do opts="${opts/$o/}" ; done
    extra=""

    [ "$COMP_CWORD" = 1 ] || \
    case "$prev" in
        -case)
            opts="" ; extra="-d" ;;
        -fileHandler)
            opts="uncollated collated masterUncollated" ; extra="" ;;
        -cellSet|-cellZone|-hostRoots|-libs|-roots)
            opts="" ; extra="" ;;
        -mesh) opts="$(_mesh ${cur})" ;;
        -region) opts="$(_region ${cur})" ;;
       *) ;;
    esac
    COMPREPLY=( $(compgen -W "${opts}" $extra -- ${cur}) )
}
complete -o filenames -o nospace -F _engineCompRatio_ engineCompRatio

_engineSwirl_ ()
{
    local cur="${COMP_WORDS[COMP_CWORD]}"
    local prev="${COMP_WORDS[COMP_CWORD-1]}"
    local line=${COMP_LINE}
    local used=$(echo "$line" | grep -oE "\-[a-zA-Z]+ ")

    opts="-case -doc -fileHandler -help -hostRoots -libs -noFunctionObjects -parallel -roots -srcDoc"
    for o in $used ; do opts="${opts/$o/}" ; done
    extra=""

    [ "$COMP_CWORD" = 1 ] || \
    case "$prev" in
        -case)
            opts="" ; extra="-d" ;;
        -fileHandler)
            opts="uncollated collated masterUncollated" ; extra="" ;;
        -hostRoots|-libs|-roots)
            opts="" ; extra="" ;;
       *) ;;
    esac
    COMPREPLY=( $(compgen -W "${opts}" $extra -- ${cur}) )
}
complete -o filenames -o nospace -F _engineSwirl_ engineSwirl

_equilibriumCO_ ()
{
    local cur="${COMP_WORDS[COMP_CWORD]}"
    local prev="${COMP_WORDS[COMP_CWORD-1]}"
    local line=${COMP_LINE}
    local used=$(echo "$line" | grep -oE "\-[a-zA-Z]+ ")

    opts="-case -doc -fileHandler -help -hostRoots -libs -noFunctionObjects -parallel -roots -srcDoc"
    for o in $used ; do opts="${opts/$o/}" ; done
    extra=""

    [ "$COMP_CWORD" = 1 ] || \
    case "$prev" in
        -case)
            opts="" ; extra="-d" ;;
        -fileHandler)
            opts="uncollated collated masterUncollated" ; extra="" ;;
        -hostRoots|-libs|-roots)
            opts="" ; extra="" ;;
       *) ;;
    esac
    COMPREPLY=( $(compgen -W "${opts}" $extra -- ${cur}) )
}
complete -o filenames -o nospace -F _equilibriumCO_ equilibriumCO

_equilibriumFlameT_ ()
{
    local cur="${COMP_WORDS[COMP_CWORD]}"
    local prev="${COMP_WORDS[COMP_CWORD-1]}"
    local line=${COMP_LINE}
    local used=$(echo "$line" | grep -oE "\-[a-zA-Z]+ ")

    opts="-doc -help -srcDoc"
    for o in $used ; do opts="${opts/$o/}" ; done
    extra=""

    [ "$COMP_CWORD" = 1 ] || \
    case "$prev" in
       *) ;;
    esac
    COMPREPLY=( $(compgen -W "${opts}" $extra -- ${cur}) )
}
complete -o filenames -o nospace -F _equilibriumFlameT_ equilibriumFlameT

_extrude2DMesh_ ()
{
    local cur="${COMP_WORDS[COMP_CWORD]}"
    local prev="${COMP_WORDS[COMP_CWORD-1]}"
    local line=${COMP_LINE}
    local used=$(echo "$line" | grep -oE "\-[a-zA-Z]+ ")

    opts="-case -doc -fileHandler -help -hostRoots -libs -noFunctionObjects -noOverwrite -overwrite -parallel -roots -srcDoc"
    for o in $used ; do opts="${opts/$o/}" ; done
    extra=""

    [ "$COMP_CWORD" = 1 ] || \
    case "$prev" in
        -case)
            opts="" ; extra="-d" ;;
        -fileHandler)
            opts="uncollated collated masterUncollated" ; extra="" ;;
        -hostRoots|-libs|-roots)
            opts="" ; extra="" ;;
       *) ;;
    esac
    COMPREPLY=( $(compgen -W "${opts}" $extra -- ${cur}) )
}
complete -o filenames -o nospace -F _extrude2DMesh_ extrude2DMesh

_extrudeMesh_ ()
{
    local cur="${COMP_WORDS[COMP_CWORD]}"
    local prev="${COMP_WORDS[COMP_CWORD-1]}"
    local line=${COMP_LINE}
    local used=$(echo "$line" | grep -oE "\-[a-zA-Z]+ ")

    opts="-case -dict -doc -fileHandler -help -hostRoots -libs -mesh -noFunctionObjects -parallel -region -roots -srcDoc"
    for o in $used ; do opts="${opts/$o/}" ; done
    extra=""

    [ "$COMP_CWORD" = 1 ] || \
    case "$prev" in
        -case)
            opts="" ; extra="-d" ;;
        -dict)
            opts="" ; extra="-d -f" ;;
        -fileHandler)
            opts="uncollated collated masterUncollated" ; extra="" ;;
        -hostRoots|-libs|-roots)
            opts="" ; extra="" ;;
        -mesh) opts="$(_mesh ${cur})" ;;
        -region) opts="$(_region ${cur})" ;;
       *) ;;
    esac
    COMPREPLY=( $(compgen -W "${opts}" $extra -- ${cur}) )
}
complete -o filenames -o nospace -F _extrudeMesh_ extrudeMesh

_extrudeToRegionMesh_ ()
{
    local cur="${COMP_WORDS[COMP_CWORD]}"
    local prev="${COMP_WORDS[COMP_CWORD-1]}"
    local line=${COMP_LINE}
    local used=$(echo "$line" | grep -oE "\-[a-zA-Z]+ ")

    opts="-case -dict -doc -fileHandler -help -hostRoots -libs -mesh -noFunctionObjects -noOverwrite -overwrite -parallel -region -roots -srcDoc"
    for o in $used ; do opts="${opts/$o/}" ; done
    extra=""

    [ "$COMP_CWORD" = 1 ] || \
    case "$prev" in
        -case)
            opts="" ; extra="-d" ;;
        -dict)
            opts="" ; extra="-d -f" ;;
        -fileHandler)
            opts="uncollated collated masterUncollated" ; extra="" ;;
        -hostRoots|-libs|-roots)
            opts="" ; extra="" ;;
        -mesh) opts="$(_mesh ${cur})" ;;
        -region) opts="$(_region ${cur})" ;;
       *) ;;
    esac
    COMPREPLY=( $(compgen -W "${opts}" $extra -- ${cur}) )
}
complete -o filenames -o nospace -F _extrudeToRegionMesh_ extrudeToRegionMesh

_faceAgglomerate_ ()
{
    local cur="${COMP_WORDS[COMP_CWORD]}"
    local prev="${COMP_WORDS[COMP_CWORD-1]}"
    local line=${COMP_LINE}
    local used=$(echo "$line" | grep -oE "\-[a-zA-Z]+ ")

    opts="-case -dict -doc -fileHandler -help -hostRoots -libs -mesh -noFunctionObjects -parallel -region -roots -srcDoc"
    for o in $used ; do opts="${opts/$o/}" ; done
    extra=""

    [ "$COMP_CWORD" = 1 ] || \
    case "$prev" in
        -case)
            opts="" ; extra="-d" ;;
        -dict)
            opts="" ; extra="-d -f" ;;
        -fileHandler)
            opts="uncollated collated masterUncollated" ; extra="" ;;
        -hostRoots|-libs|-roots)
            opts="" ; extra="" ;;
        -mesh) opts="$(_mesh ${cur})" ;;
        -region) opts="$(_region ${cur})" ;;
       *) ;;
    esac
    COMPREPLY=( $(compgen -W "${opts}" $extra -- ${cur}) )
}
complete -o filenames -o nospace -F _faceAgglomerate_ faceAgglomerate

_financialFoam_ ()
{
    local cur="${COMP_WORDS[COMP_CWORD]}"
    local prev="${COMP_WORDS[COMP_CWORD-1]}"
    local line=${COMP_LINE}
    local used=$(echo "$line" | grep -oE "\-[a-zA-Z]+ ")

    opts="-case -doc -fileHandler -help -hostRoots -libs -noFunctionObjects -parallel -postProcess -roots -srcDoc"
    for o in $used ; do opts="${opts/$o/}" ; done
    extra=""

    [ "$COMP_CWORD" = 1 ] || \
    case "$prev" in
        -case)
            opts="" ; extra="-d" ;;
        -fileHandler)
            opts="uncollated collated masterUncollated" ; extra="" ;;
        -hostRoots|-libs|-roots)
            opts="" ; extra="" ;;
       *) ;;
    esac
    COMPREPLY=( $(compgen -W "${opts}" $extra -- ${cur}) )
}
complete -o filenames -o nospace -F _financialFoam_ financialFoam

_flattenMesh_ ()
{
    local cur="${COMP_WORDS[COMP_CWORD]}"
    local prev="${COMP_WORDS[COMP_CWORD-1]}"
    local line=${COMP_LINE}
    local used=$(echo "$line" | grep -oE "\-[a-zA-Z]+ ")

    opts="-case -doc -fileHandler -help -hostRoots -libs -noFunctionObjects -parallel -roots -srcDoc"
    for o in $used ; do opts="${opts/$o/}" ; done
    extra=""

    [ "$COMP_CWORD" = 1 ] || \
    case "$prev" in
        -case)
            opts="" ; extra="-d" ;;
        -fileHandler)
            opts="uncollated collated masterUncollated" ; extra="" ;;
        -hostRoots|-libs|-roots)
            opts="" ; extra="" ;;
       *) ;;
    esac
    COMPREPLY=( $(compgen -W "${opts}" $extra -- ${cur}) )
}
complete -o filenames -o nospace -F _flattenMesh_ flattenMesh

_fluent3DMeshToFoam_ ()
{
    local cur="${COMP_WORDS[COMP_CWORD]}"
    local prev="${COMP_WORDS[COMP_CWORD-1]}"
    local line=${COMP_LINE}
    local used=$(echo "$line" | grep -oE "\-[a-zA-Z]+ ")

    opts="-case -cubit -doc -fileHandler -help -ignoreCellGroups -ignoreFaceGroups -includedAngle -libs -noFunctionObjects -scale -srcDoc"
    for o in $used ; do opts="${opts/$o/}" ; done
    extra="-d -f"

    [ "$COMP_CWORD" = 1 ] || \
    case "$prev" in
        -case)
            opts="" ; extra="-d" ;;
        -fileHandler)
            opts="uncollated collated masterUncollated" ; extra="" ;;
        -ignoreCellGroups|-ignoreFaceGroups|-includedAngle|-libs|-scale)
            opts="" ; extra="" ;;
       -*) ;;
        *)
            case "${COMP_WORDS[COMP_CWORD-2]}" in
                -ignoreCellGroups|-ignoreFaceGroups|-includedAngle|-libs|-scale|-case|-fileHandler) ;;
                *) opts=""; extra="" ;;
            esac
            ;;
    esac
    COMPREPLY=( $(compgen -W "${opts}" $extra -- ${cur}) )
}
complete -o filenames -o nospace -F _fluent3DMeshToFoam_ fluent3DMeshToFoam

_fluentMeshToFoam_ ()
{
    local cur="${COMP_WORDS[COMP_CWORD]}"
    local prev="${COMP_WORDS[COMP_CWORD-1]}"
    local line=${COMP_LINE}
    local used=$(echo "$line" | grep -oE "\-[a-zA-Z]+ ")

    opts="-2D -case -doc -fileHandler -help -libs -noFunctionObjects -scale -srcDoc -writeSets -writeZones"
    for o in $used ; do opts="${opts/$o/}" ; done
    extra="-d -f"

    [ "$COMP_CWORD" = 1 ] || \
    case "$prev" in
        -case)
            opts="" ; extra="-d" ;;
        -fileHandler)
            opts="uncollated collated masterUncollated" ; extra="" ;;
        -2D|-libs|-scale)
            opts="" ; extra="" ;;
       -*) ;;
        *)
            case "${COMP_WORDS[COMP_CWORD-2]}" in
                -2D|-libs|-scale|-case|-fileHandler) ;;
                *) opts=""; extra="" ;;
            esac
            ;;
    esac
    COMPREPLY=( $(compgen -W "${opts}" $extra -- ${cur}) )
}
complete -o filenames -o nospace -F _fluentMeshToFoam_ fluentMeshToFoam

_foamDataToFluent_ ()
{
    local cur="${COMP_WORDS[COMP_CWORD]}"
    local prev="${COMP_WORDS[COMP_CWORD-1]}"
    local line=${COMP_LINE}
    local used=$(echo "$line" | grep -oE "\-[a-zA-Z]+ ")

    opts="-case -doc -fileHandler -help -latestTime -libs -noFunctionObjects -noZero -srcDoc -time"
    for o in $used ; do opts="${opts/$o/}" ; done
    extra=""

    [ "$COMP_CWORD" = 1 ] || \
    case "$prev" in
        -case)
            opts="" ; extra="-d" ;;
        -fileHandler)
            opts="uncollated collated masterUncollated" ; extra="" ;;
        -time)
            opts="$(foamListTimes -withZero 2> /dev/null)" ; extra="" ;;
        -libs)
            opts="" ; extra="" ;;
       *) ;;
    esac
    COMPREPLY=( $(compgen -W "${opts}" $extra -- ${cur}) )
}
complete -o filenames -o nospace -F _foamDataToFluent_ foamDataToFluent

_foamDictionary_ ()
{
    local cur="${COMP_WORDS[COMP_CWORD]}"
    local prev="${COMP_WORDS[COMP_CWORD-1]}"
    local line=${COMP_LINE}
    local used=$(echo "$line" | grep -oE "\-[a-zA-Z]+ ")

    opts="-add -case -dict -diff -doc -entry -expand -fileHandler -help -hostRoots -includes -keywords -libs -merge -noFunctionObjects -output -parallel -quiet -remove -rename -roots -set -srcDoc -value -writePrecision"
    for o in $used ; do opts="${opts/$o/}" ; done
    extra="-d -f"

    [ "$COMP_CWORD" = 1 ] || \
    case "$prev" in
        -case)
            opts="" ; extra="-d" ;;
        -fileHandler)
            opts="uncollated collated masterUncollated" ; extra="" ;;
        -add|-diff|-entry|-hostRoots|-libs|-merge|-output|-rename|-roots|-set|-writePrecision)
            opts="" ; extra="" ;;
       -*) ;;
        *)
            case "${COMP_WORDS[COMP_CWORD-2]}" in
                -add|-diff|-entry|-hostRoots|-libs|-merge|-output|-rename|-roots|-set|-writePrecision|-case|-fileHandler) ;;
                *) opts=""; extra="" ;;
            esac
            ;;
    esac
    COMPREPLY=( $(compgen -W "${opts}" $extra -- ${cur}) )
}
complete -o filenames -o nospace -F _foamDictionary_ foamDictionary

_foamFormatConvert_ ()
{
    local cur="${COMP_WORDS[COMP_CWORD]}"
    local prev="${COMP_WORDS[COMP_CWORD-1]}"
    local line=${COMP_LINE}
    local used=$(echo "$line" | grep -oE "\-[a-zA-Z]+ ")

    opts="-case -constant -doc -fileHandler -help -hostRoots -latestTime -libs -noConstant -noFunctionObjects -noZero -parallel -region -roots -srcDoc -time"
    for o in $used ; do opts="${opts/$o/}" ; done
    extra=""

    [ "$COMP_CWORD" = 1 ] || \
    case "$prev" in
        -case)
            opts="" ; extra="-d" ;;
        -fileHandler)
            opts="uncollated collated masterUncollated" ; extra="" ;;
        -time)
            opts="$(foamListTimes -withZero 2> /dev/null)" ; extra="" ;;
        -hostRoots|-libs|-roots)
            opts="" ; extra="" ;;
        -region) opts="$(_region ${cur})" ;;
       *) ;;
    esac
    COMPREPLY=( $(compgen -W "${opts}" $extra -- ${cur}) )
}
complete -o filenames -o nospace -F _foamFormatConvert_ foamFormatConvert

_foamListTimes_ ()
{
    local cur="${COMP_WORDS[COMP_CWORD]}"
    local prev="${COMP_WORDS[COMP_CWORD-1]}"
    local line=${COMP_LINE}
    local used=$(echo "$line" | grep -oE "\-[a-zA-Z]+ ")

    opts="-case -constant -doc -fileHandler -functionEntries -help -latestTime -libs -noZero -processor -rm -srcDoc -time -withZero"
    for o in $used ; do opts="${opts/$o/}" ; done
    extra=""

    [ "$COMP_CWORD" = 1 ] || \
    case "$prev" in
        -case)
            opts="" ; extra="-d" ;;
        -fileHandler)
            opts="uncollated collated masterUncollated" ; extra="" ;;
        -time)
            opts="$(foamListTimes -withZero 2> /dev/null)" ; extra="" ;;
        -libs)
            opts="" ; extra="" ;;
       *) ;;
    esac
    COMPREPLY=( $(compgen -W "${opts}" $extra -- ${cur}) )
}
complete -o filenames -o nospace -F _foamListTimes_ foamListTimes

_foamMeshToFluent_ ()
{
    local cur="${COMP_WORDS[COMP_CWORD]}"
    local prev="${COMP_WORDS[COMP_CWORD-1]}"
    local line=${COMP_LINE}
    local used=$(echo "$line" | grep -oE "\-[a-zA-Z]+ ")

    opts="-case -doc -fileHandler -help -libs -noFunctionObjects -srcDoc"
    for o in $used ; do opts="${opts/$o/}" ; done
    extra=""

    [ "$COMP_CWORD" = 1 ] || \
    case "$prev" in
        -case)
            opts="" ; extra="-d" ;;
        -fileHandler)
            opts="uncollated collated masterUncollated" ; extra="" ;;
        -libs)
            opts="" ; extra="" ;;
       *) ;;
    esac
    COMPREPLY=( $(compgen -W "${opts}" $extra -- ${cur}) )
}
complete -o filenames -o nospace -F _foamMeshToFluent_ foamMeshToFluent

_foamMultiRun_ ()
{
    local cur="${COMP_WORDS[COMP_CWORD]}"
    local prev="${COMP_WORDS[COMP_CWORD-1]}"
    local line=${COMP_LINE}
    local used=$(echo "$line" | grep -oE "\-[a-zA-Z]+ ")

    opts="-case -doc -fileHandler -help -hostRoots -libs -noFunctionObjects -parallel -roots -srcDoc"
    for o in $used ; do opts="${opts/$o/}" ; done
    extra=""

    [ "$COMP_CWORD" = 1 ] || \
    case "$prev" in
        -case)
            opts="" ; extra="-d" ;;
        -fileHandler)
            opts="uncollated collated masterUncollated" ; extra="" ;;
        -hostRoots|-libs|-roots)
            opts="" ; extra="" ;;
       *) ;;
    esac
    COMPREPLY=( $(compgen -W "${opts}" $extra -- ${cur}) )
}
complete -o filenames -o nospace -F _foamMultiRun_ foamMultiRun

_foamPostProcess_ ()
{
    local cur="${COMP_WORDS[COMP_CWORD]}"
    local prev="${COMP_WORDS[COMP_CWORD-1]}"
    local line=${COMP_LINE}
    local used=$(echo "$line" | grep -oE "\-[a-zA-Z]+ ")

    opts="-case -constant -dict -doc -field -fields -fileHandler -func -funcs -help -hostRoots -latestTime -libs -list -listTemplates -noFunctionObjects -noZero -parallel -region -roots -solver -srcDoc -time"
    for o in $used ; do opts="${opts/$o/}" ; done
    extra=""

    [ "$COMP_CWORD" = 1 ] || \
    case "$prev" in
        -case)
            opts="" ; extra="-d" ;;
        -dict)
            opts="" ; extra="-d -f" ;;
        -fileHandler)
            opts="uncollated collated masterUncollated" ; extra="" ;;
        -time)
            opts="$(foamListTimes -withZero 2> /dev/null)" ; extra="" ;;
        -field|-fields|-funcs|-hostRoots|-libs|-roots)
            opts="" ; extra="" ;;
        -func) opts="$(_func ${cur})" ;;
        -region) opts="$(_region ${cur})" ;;
        -solver) opts="$(_solver ${cur})" ;;
       *) ;;
    esac
    COMPREPLY=( $(compgen -W "${opts}" $extra -- ${cur}) )
}
complete -o filenames -o nospace -F _foamPostProcess_ foamPostProcess

_foamRun_ ()
{
    local cur="${COMP_WORDS[COMP_CWORD]}"
    local prev="${COMP_WORDS[COMP_CWORD-1]}"
    local line=${COMP_LINE}
    local used=$(echo "$line" | grep -oE "\-[a-zA-Z]+ ")

    opts="-case -doc -fileHandler -help -hostRoots -libs -noFunctionObjects -parallel -roots -solver -srcDoc"
    for o in $used ; do opts="${opts/$o/}" ; done
    extra=""

    [ "$COMP_CWORD" = 1 ] || \
    case "$prev" in
        -case)
            opts="" ; extra="-d" ;;
        -fileHandler)
            opts="uncollated collated masterUncollated" ; extra="" ;;
        -hostRoots|-libs|-roots)
            opts="" ; extra="" ;;
        -solver) opts="$(_solver ${cur})" ;;
       *) ;;
    esac
    COMPREPLY=( $(compgen -W "${opts}" $extra -- ${cur}) )
}
complete -o filenames -o nospace -F _foamRun_ foamRun

_foamSetupCHT_ ()
{
    local cur="${COMP_WORDS[COMP_CWORD]}"
    local prev="${COMP_WORDS[COMP_CWORD-1]}"
    local line=${COMP_LINE}
    local used=$(echo "$line" | grep -oE "\-[a-zA-Z]+ ")

    opts="-case -doc -fileHandler -help -hostRoots -libs -noFunctionObjects -nonConformalCouples -parallel -roots -srcDoc"
    for o in $used ; do opts="${opts/$o/}" ; done
    extra=""

    [ "$COMP_CWORD" = 1 ] || \
    case "$prev" in
        -case)
            opts="" ; extra="-d" ;;
        -fileHandler)
            opts="uncollated collated masterUncollated" ; extra="" ;;
        -hostRoots|-libs|-roots)
            opts="" ; extra="" ;;
       *) ;;
    esac
    COMPREPLY=( $(compgen -W "${opts}" $extra -- ${cur}) )
}
complete -o filenames -o nospace -F _foamSetupCHT_ foamSetupCHT

_foamToC_ ()
{
    local cur="${COMP_WORDS[COMP_CWORD]}"
    local prev="${COMP_WORDS[COMP_CWORD-1]}"
    local line=${COMP_LINE}
    local used=$(echo "$line" | grep -oE "\-[a-zA-Z]+ ")

    opts="-all -doc -functionObjects -fvConstraints -fvModels -help -libs -listLibs -noLibs -scalarBCs -search -solver -solvers -srcDoc -switches -table -tables -vectorBCs"
    for o in $used ; do opts="${opts/$o/}" ; done
    extra=""

    [ "$COMP_CWORD" = 1 ] || \
    case "$prev" in
        -libs|-search)
            opts="" ; extra="" ;;
        -solver) opts="$(_solver ${cur})" ;;
        -table) opts="$(_table ${cur})" ;;
       *) ;;
    esac
    COMPREPLY=( $(compgen -W "${opts}" $extra -- ${cur}) )
}
complete -o filenames -o nospace -F _foamToC_ foamToC

_foamToEnsight_ ()
{
    local cur="${COMP_WORDS[COMP_CWORD]}"
    local prev="${COMP_WORDS[COMP_CWORD-1]}"
    local line=${COMP_LINE}
    local used=$(echo "$line" | grep -oE "\-[a-zA-Z]+ ")

    opts="-ascii -case -cellZone -constant -doc -faceZones -fields -fileHandler -help -hostRoots -latestTime -libs -nodeValues -noFunctionObjects -noPatches -noZero -parallel -patches -region -roots -srcDoc -time"
    for o in $used ; do opts="${opts/$o/}" ; done
    extra=""

    [ "$COMP_CWORD" = 1 ] || \
    case "$prev" in
        -case)
            opts="" ; extra="-d" ;;
        -fileHandler)
            opts="uncollated collated masterUncollated" ; extra="" ;;
        -time)
            opts="$(foamListTimes -withZero 2> /dev/null)" ; extra="" ;;
        -cellZone|-faceZones|-fields|-hostRoots|-libs|-patches|-roots)
            opts="" ; extra="" ;;
        -region) opts="$(_region ${cur})" ;;
       *) ;;
    esac
    COMPREPLY=( $(compgen -W "${opts}" $extra -- ${cur}) )
}
complete -o filenames -o nospace -F _foamToEnsight_ foamToEnsight

_foamToEnsightParts_ ()
{
    local cur="${COMP_WORDS[COMP_CWORD]}"
    local prev="${COMP_WORDS[COMP_CWORD-1]}"
    local line=${COMP_LINE}
    local used=$(echo "$line" | grep -oE "\-[a-zA-Z]+ ")

    opts="-ascii -case -constant -doc -fileHandler -help -index -latestTime -libs -name -noFunctionObjects -noMesh -noZero -srcDoc -time -width"
    for o in $used ; do opts="${opts/$o/}" ; done
    extra=""

    [ "$COMP_CWORD" = 1 ] || \
    case "$prev" in
        -case)
            opts="" ; extra="-d" ;;
        -fileHandler)
            opts="uncollated collated masterUncollated" ; extra="" ;;
        -time)
            opts="$(foamListTimes -withZero 2> /dev/null)" ; extra="" ;;
        -index|-libs|-name|-width)
            opts="" ; extra="" ;;
       *) ;;
    esac
    COMPREPLY=( $(compgen -W "${opts}" $extra -- ${cur}) )
}
complete -o filenames -o nospace -F _foamToEnsightParts_ foamToEnsightParts

_foamToGMV_ ()
{
    local cur="${COMP_WORDS[COMP_CWORD]}"
    local prev="${COMP_WORDS[COMP_CWORD-1]}"
    local line=${COMP_LINE}
    local used=$(echo "$line" | grep -oE "\-[a-zA-Z]+ ")

    opts="-case -doc -fileHandler -help -hostRoots -libs -noFunctionObjects -parallel -roots -srcDoc"
    for o in $used ; do opts="${opts/$o/}" ; done
    extra=""

    [ "$COMP_CWORD" = 1 ] || \
    case "$prev" in
        -case)
            opts="" ; extra="-d" ;;
        -fileHandler)
            opts="uncollated collated masterUncollated" ; extra="" ;;
        -hostRoots|-libs|-roots)
            opts="" ; extra="" ;;
       *) ;;
    esac
    COMPREPLY=( $(compgen -W "${opts}" $extra -- ${cur}) )
}
complete -o filenames -o nospace -F _foamToGMV_ foamToGMV

_foamToStarMesh_ ()
{
    local cur="${COMP_WORDS[COMP_CWORD]}"
    local prev="${COMP_WORDS[COMP_CWORD-1]}"
    local line=${COMP_LINE}
    local used=$(echo "$line" | grep -oE "\-[a-zA-Z]+ ")

    opts="-case -constant -doc -fileHandler -help -latestTime -libs -noBnd -noFunctionObjects -noZero -scale -srcDoc -time"
    for o in $used ; do opts="${opts/$o/}" ; done
    extra=""

    [ "$COMP_CWORD" = 1 ] || \
    case "$prev" in
        -case)
            opts="" ; extra="-d" ;;
        -fileHandler)
            opts="uncollated collated masterUncollated" ; extra="" ;;
        -time)
            opts="$(foamListTimes -withZero 2> /dev/null)" ; extra="" ;;
        -libs|-scale)
            opts="" ; extra="" ;;
       *) ;;
    esac
    COMPREPLY=( $(compgen -W "${opts}" $extra -- ${cur}) )
}
complete -o filenames -o nospace -F _foamToStarMesh_ foamToStarMesh

_foamToSurface_ ()
{
    local cur="${COMP_WORDS[COMP_CWORD]}"
    local prev="${COMP_WORDS[COMP_CWORD-1]}"
    local line=${COMP_LINE}
    local used=$(echo "$line" | grep -oE "\-[a-zA-Z]+ ")

    opts="-case -constant -doc -fileHandler -help -latestTime -libs -noFunctionObjects -noZero -scale -srcDoc -time -tri"
    for o in $used ; do opts="${opts/$o/}" ; done
    extra=""

    [ "$COMP_CWORD" = 1 ] || \
    case "$prev" in
        -case)
            opts="" ; extra="-d" ;;
        -fileHandler)
            opts="uncollated collated masterUncollated" ; extra="" ;;
        -time)
            opts="$(foamListTimes -withZero 2> /dev/null)" ; extra="" ;;
        -libs|-scale)
            opts="" ; extra="" ;;
       *) ;;
    esac
    COMPREPLY=( $(compgen -W "${opts}" $extra -- ${cur}) )
}
complete -o filenames -o nospace -F _foamToSurface_ foamToSurface

_foamToTetDualMesh_ ()
{
    local cur="${COMP_WORDS[COMP_CWORD]}"
    local prev="${COMP_WORDS[COMP_CWORD-1]}"
    local line=${COMP_LINE}
    local used=$(echo "$line" | grep -oE "\-[a-zA-Z]+ ")

    opts="-case -constant -doc -fileHandler -help -hostRoots -latestTime -libs -mesh -noFunctionObjects -noOverwrite -noZero -overwrite -parallel -region -roots -srcDoc -time"
    for o in $used ; do opts="${opts/$o/}" ; done
    extra=""

    [ "$COMP_CWORD" = 1 ] || \
    case "$prev" in
        -case)
            opts="" ; extra="-d" ;;
        -fileHandler)
            opts="uncollated collated masterUncollated" ; extra="" ;;
        -time)
            opts="$(foamListTimes -withZero 2> /dev/null)" ; extra="" ;;
        -hostRoots|-libs|-roots)
            opts="" ; extra="" ;;
        -mesh) opts="$(_mesh ${cur})" ;;
        -region) opts="$(_region ${cur})" ;;
       *) ;;
    esac
    COMPREPLY=( $(compgen -W "${opts}" $extra -- ${cur}) )
}
complete -o filenames -o nospace -F _foamToTetDualMesh_ foamToTetDualMesh

_foamToVTK_ ()
{
    local cur="${COMP_WORDS[COMP_CWORD]}"
    local prev="${COMP_WORDS[COMP_CWORD-1]}"
    local line=${COMP_LINE}
    local used=$(echo "$line" | grep -oE "\-[a-zA-Z]+ ")

    opts="-allPatches -ascii -case -cellSet -constant -doc -excludePatches -faceSet -fields -fileHandler -help -hostRoots -latestTime -libs -nearCellValue -noFaceZones -noFunctionObjects -noInternal -noLinks -noPointValues -noZero -parallel -pointSet -polyhedra -region -roots -srcDoc -surfaceFields -time -useTimeName"
    for o in $used ; do opts="${opts/$o/}" ; done
    extra=""

    [ "$COMP_CWORD" = 1 ] || \
    case "$prev" in
        -case)
            opts="" ; extra="-d" ;;
        -fileHandler)
            opts="uncollated collated masterUncollated" ; extra="" ;;
        -time)
            opts="$(foamListTimes -withZero 2> /dev/null)" ; extra="" ;;
        -cellSet|-excludePatches|-faceSet|-fields|-hostRoots|-libs|-pointSet|-polyhedra|-roots)
            opts="" ; extra="" ;;
        -region) opts="$(_region ${cur})" ;;
       *) ;;
    esac
    COMPREPLY=( $(compgen -W "${opts}" $extra -- ${cur}) )
}
complete -o filenames -o nospace -F _foamToVTK_ foamToVTK

_gambitToFoam_ ()
{
    local cur="${COMP_WORDS[COMP_CWORD]}"
    local prev="${COMP_WORDS[COMP_CWORD-1]}"
    local line=${COMP_LINE}
    local used=$(echo "$line" | grep -oE "\-[a-zA-Z]+ ")

    opts="-case -doc -fileHandler -help -libs -noFunctionObjects -scale -srcDoc"
    for o in $used ; do opts="${opts/$o/}" ; done
    extra="-d -f"

    [ "$COMP_CWORD" = 1 ] || \
    case "$prev" in
        -case)
            opts="" ; extra="-d" ;;
        -fileHandler)
            opts="uncollated collated masterUncollated" ; extra="" ;;
        -libs|-scale)
            opts="" ; extra="" ;;
       -*) ;;
        *)
            case "${COMP_WORDS[COMP_CWORD-2]}" in
                -libs|-scale|-case|-fileHandler) ;;
                *) opts=""; extra="" ;;
            esac
            ;;
    esac
    COMPREPLY=( $(compgen -W "${opts}" $extra -- ${cur}) )
}
complete -o filenames -o nospace -F _gambitToFoam_ gambitToFoam

_gmshToFoam_ ()
{
    local cur="${COMP_WORDS[COMP_CWORD]}"
    local prev="${COMP_WORDS[COMP_CWORD-1]}"
    local line=${COMP_LINE}
    local used=$(echo "$line" | grep -oE "\-[a-zA-Z]+ ")

    opts="-case -doc -fileHandler -help -keepOrientation -libs -mesh -noFunctionObjects -region -srcDoc"
    for o in $used ; do opts="${opts/$o/}" ; done
    extra="-d -f"

    [ "$COMP_CWORD" = 1 ] || \
    case "$prev" in
        -case)
            opts="" ; extra="-d" ;;
        -fileHandler)
            opts="uncollated collated masterUncollated" ; extra="" ;;
        -libs)
            opts="" ; extra="" ;;
        -mesh) opts="$(_mesh ${cur})" ;;
        -region) opts="$(_region ${cur})" ;;
       -*) ;;
        *)
            case "${COMP_WORDS[COMP_CWORD-2]}" in
                -libs|-case|-fileHandler) ;;
                *) opts=""; extra="" ;;
            esac
            ;;
    esac
    COMPREPLY=( $(compgen -W "${opts}" $extra -- ${cur}) )
}
complete -o filenames -o nospace -F _gmshToFoam_ gmshToFoam

_icoFoam_ ()
{
    local cur="${COMP_WORDS[COMP_CWORD]}"
    local prev="${COMP_WORDS[COMP_CWORD-1]}"
    local line=${COMP_LINE}
    local used=$(echo "$line" | grep -oE "\-[a-zA-Z]+ ")

    opts="-case -doc -fileHandler -help -hostRoots -libs -noFunctionObjects -parallel -roots -srcDoc"
    for o in $used ; do opts="${opts/$o/}" ; done
    extra=""

    [ "$COMP_CWORD" = 1 ] || \
    case "$prev" in
        -case)
            opts="" ; extra="-d" ;;
        -fileHandler)
            opts="uncollated collated masterUncollated" ; extra="" ;;
        -hostRoots|-libs|-roots)
            opts="" ; extra="" ;;
       *) ;;
    esac
    COMPREPLY=( $(compgen -W "${opts}" $extra -- ${cur}) )
}
complete -o filenames -o nospace -F _icoFoam_ icoFoam

_ideasUnvToFoam_ ()
{
    local cur="${COMP_WORDS[COMP_CWORD]}"
    local prev="${COMP_WORDS[COMP_CWORD-1]}"
    local line=${COMP_LINE}
    local used=$(echo "$line" | grep -oE "\-[a-zA-Z]+ ")

    opts="-case -doc -dump -fileHandler -help -libs -noFunctionObjects -region -srcDoc"
    for o in $used ; do opts="${opts/$o/}" ; done
    extra="-d -f"

    [ "$COMP_CWORD" = 1 ] || \
    case "$prev" in
        -case)
            opts="" ; extra="-d" ;;
        -fileHandler)
            opts="uncollated collated masterUncollated" ; extra="" ;;
        -libs)
            opts="" ; extra="" ;;
        -region) opts="$(_region ${cur})" ;;
       -*) ;;
        *)
            case "${COMP_WORDS[COMP_CWORD-2]}" in
                -libs|-case|-fileHandler) ;;
                *) opts=""; extra="" ;;
            esac
            ;;
    esac
    COMPREPLY=( $(compgen -W "${opts}" $extra -- ${cur}) )
}
complete -o filenames -o nospace -F _ideasUnvToFoam_ ideasUnvToFoam

_insideCells_ ()
{
    local cur="${COMP_WORDS[COMP_CWORD]}"
    local prev="${COMP_WORDS[COMP_CWORD-1]}"
    local line=${COMP_LINE}
    local used=$(echo "$line" | grep -oE "\-[a-zA-Z]+ ")

    opts="-case -doc -fileHandler -help -libs -noFunctionObjects -srcDoc"
    for o in $used ; do opts="${opts/$o/}" ; done
    extra="-d -f"

    [ "$COMP_CWORD" = 1 ] || \
    case "$prev" in
        -case)
            opts="" ; extra="-d" ;;
        -fileHandler)
            opts="uncollated collated masterUncollated" ; extra="" ;;
        -libs)
            opts="" ; extra="" ;;
       -*) ;;
        *)
            case "${COMP_WORDS[COMP_CWORD-2]}" in
                -libs|-case|-fileHandler) ;;
                *) opts=""; extra="" ;;
            esac
            ;;
    esac
    COMPREPLY=( $(compgen -W "${opts}" $extra -- ${cur}) )
}
complete -o filenames -o nospace -F _insideCells_ insideCells

_kivaToFoam_ ()
{
    local cur="${COMP_WORDS[COMP_CWORD]}"
    local prev="${COMP_WORDS[COMP_CWORD-1]}"
    local line=${COMP_LINE}
    local used=$(echo "$line" | grep -oE "\-[a-zA-Z]+ ")

    opts="-case -doc -file -fileHandler -help -libs -noFunctionObjects -srcDoc -version -zHeadMin"
    for o in $used ; do opts="${opts/$o/}" ; done
    extra=""

    [ "$COMP_CWORD" = 1 ] || \
    case "$prev" in
        -case)
            opts="" ; extra="-d" ;;
        -fileHandler)
            opts="uncollated collated masterUncollated" ; extra="" ;;
        -file|-libs|-version|-zHeadMin)
            opts="" ; extra="" ;;
       *) ;;
    esac
    COMPREPLY=( $(compgen -W "${opts}" $extra -- ${cur}) )
}
complete -o filenames -o nospace -F _kivaToFoam_ kivaToFoam

_laplacianFoam_ ()
{
    local cur="${COMP_WORDS[COMP_CWORD]}"
    local prev="${COMP_WORDS[COMP_CWORD-1]}"
    local line=${COMP_LINE}
    local used=$(echo "$line" | grep -oE "\-[a-zA-Z]+ ")

    opts="-case -doc -fileHandler -help -hostRoots -libs -noFunctionObjects -parallel -roots -srcDoc"
    for o in $used ; do opts="${opts/$o/}" ; done
    extra=""

    [ "$COMP_CWORD" = 1 ] || \
    case "$prev" in
        -case)
            opts="" ; extra="-d" ;;
        -fileHandler)
            opts="uncollated collated masterUncollated" ; extra="" ;;
        -hostRoots|-libs|-roots)
            opts="" ; extra="" ;;
       *) ;;
    esac
    COMPREPLY=( $(compgen -W "${opts}" $extra -- ${cur}) )
}
complete -o filenames -o nospace -F _laplacianFoam_ laplacianFoam

_magneticFoam_ ()
{
    local cur="${COMP_WORDS[COMP_CWORD]}"
    local prev="${COMP_WORDS[COMP_CWORD-1]}"
    local line=${COMP_LINE}
    local used=$(echo "$line" | grep -oE "\-[a-zA-Z]+ ")

    opts="-case -doc -fileHandler -HdotGradH -help -hostRoots -libs -noB -noFunctionObjects -noH -parallel -roots -srcDoc"
    for o in $used ; do opts="${opts/$o/}" ; done
    extra=""

    [ "$COMP_CWORD" = 1 ] || \
    case "$prev" in
        -case)
            opts="" ; extra="-d" ;;
        -fileHandler)
            opts="uncollated collated masterUncollated" ; extra="" ;;
        -hostRoots|-libs|-roots)
            opts="" ; extra="" ;;
       *) ;;
    esac
    COMPREPLY=( $(compgen -W "${opts}" $extra -- ${cur}) )
}
complete -o filenames -o nospace -F _magneticFoam_ magneticFoam

_mapFields_ ()
{
    local cur="${COMP_WORDS[COMP_CWORD]}"
    local prev="${COMP_WORDS[COMP_CWORD-1]}"
    local line=${COMP_LINE}
    local used=$(echo "$line" | grep -oE "\-[a-zA-Z]+ ")

    opts="-case -consistent -doc -fileHandler -help -libs -mapMethod -noFunctionObjects -parallelSource -parallelTarget -sourceRegion -sourceTime -srcDoc -targetRegion"
    for o in $used ; do opts="${opts/$o/}" ; done
    extra="-d"

    [ "$COMP_CWORD" = 1 ] || \
    case "$prev" in
        -case)
            opts="" ; extra="-d" ;;
        -fileHandler)
            opts="uncollated collated masterUncollated" ; extra="" ;;
        -libs|-mapMethod|-sourceRegion|-sourceTime|-targetRegion)
            opts="" ; extra="" ;;
       -*) ;;
        *)
            case "${COMP_WORDS[COMP_CWORD-2]}" in
                -libs|-mapMethod|-sourceRegion|-sourceTime|-targetRegion|-case|-fileHandler) ;;
                *) opts=""; extra="" ;;
            esac
            ;;
    esac
    COMPREPLY=( $(compgen -W "${opts}" $extra -- ${cur}) )
}
complete -o filenames -o nospace -F _mapFields_ mapFields

_mapFieldsPar_ ()
{
    local cur="${COMP_WORDS[COMP_CWORD]}"
    local prev="${COMP_WORDS[COMP_CWORD-1]}"
    local line=${COMP_LINE}
    local used=$(echo "$line" | grep -oE "\-[a-zA-Z]+ ")

    opts="-case -consistent -doc -fields -fileHandler -help -hostRoots -libs -mapMethod -noFunctionObjects -noLagrangian -parallel -roots -sourceRegion -sourceTime -srcDoc -targetRegion"
    for o in $used ; do opts="${opts/$o/}" ; done
    extra="-d"

    [ "$COMP_CWORD" = 1 ] || \
    case "$prev" in
        -case)
            opts="" ; extra="-d" ;;
        -fileHandler)
            opts="uncollated collated masterUncollated" ; extra="" ;;
        -fields|-hostRoots|-libs|-mapMethod|-roots|-sourceRegion|-sourceTime|-targetRegion)
            opts="" ; extra="" ;;
       -*) ;;
        *)
            case "${COMP_WORDS[COMP_CWORD-2]}" in
                -fields|-hostRoots|-libs|-mapMethod|-roots|-sourceRegion|-sourceTime|-targetRegion|-case|-fileHandler) ;;
                *) opts=""; extra="" ;;
            esac
            ;;
    esac
    COMPREPLY=( $(compgen -W "${opts}" $extra -- ${cur}) )
}
complete -o filenames -o nospace -F _mapFieldsPar_ mapFieldsPar

_mdEquilibrationFoam_ ()
{
    local cur="${COMP_WORDS[COMP_CWORD]}"
    local prev="${COMP_WORDS[COMP_CWORD-1]}"
    local line=${COMP_LINE}
    local used=$(echo "$line" | grep -oE "\-[a-zA-Z]+ ")

    opts="-case -doc -fileHandler -help -hostRoots -libs -noFunctionObjects -parallel -roots -srcDoc"
    for o in $used ; do opts="${opts/$o/}" ; done
    extra=""

    [ "$COMP_CWORD" = 1 ] || \
    case "$prev" in
        -case)
            opts="" ; extra="-d" ;;
        -fileHandler)
            opts="uncollated collated masterUncollated" ; extra="" ;;
        -hostRoots|-libs|-roots)
            opts="" ; extra="" ;;
       *) ;;
    esac
    COMPREPLY=( $(compgen -W "${opts}" $extra -- ${cur}) )
}
complete -o filenames -o nospace -F _mdEquilibrationFoam_ mdEquilibrationFoam

_mdFoam_ ()
{
    local cur="${COMP_WORDS[COMP_CWORD]}"
    local prev="${COMP_WORDS[COMP_CWORD-1]}"
    local line=${COMP_LINE}
    local used=$(echo "$line" | grep -oE "\-[a-zA-Z]+ ")

    opts="-case -doc -fileHandler -help -hostRoots -libs -noFunctionObjects -parallel -postProcess -roots -srcDoc"
    for o in $used ; do opts="${opts/$o/}" ; done
    extra=""

    [ "$COMP_CWORD" = 1 ] || \
    case "$prev" in
        -case)
            opts="" ; extra="-d" ;;
        -fileHandler)
            opts="uncollated collated masterUncollated" ; extra="" ;;
        -hostRoots|-libs|-roots)
            opts="" ; extra="" ;;
       *) ;;
    esac
    COMPREPLY=( $(compgen -W "${opts}" $extra -- ${cur}) )
}
complete -o filenames -o nospace -F _mdFoam_ mdFoam

_mdInitialise_ ()
{
    local cur="${COMP_WORDS[COMP_CWORD]}"
    local prev="${COMP_WORDS[COMP_CWORD-1]}"
    local line=${COMP_LINE}
    local used=$(echo "$line" | grep -oE "\-[a-zA-Z]+ ")

    opts="-case -doc -fileHandler -help -hostRoots -libs -noFunctionObjects -parallel -roots -srcDoc"
    for o in $used ; do opts="${opts/$o/}" ; done
    extra=""

    [ "$COMP_CWORD" = 1 ] || \
    case "$prev" in
        -case)
            opts="" ; extra="-d" ;;
        -fileHandler)
            opts="uncollated collated masterUncollated" ; extra="" ;;
        -hostRoots|-libs|-roots)
            opts="" ; extra="" ;;
       *) ;;
    esac
    COMPREPLY=( $(compgen -W "${opts}" $extra -- ${cur}) )
}
complete -o filenames -o nospace -F _mdInitialise_ mdInitialise

_mergeBaffles_ ()
{
    local cur="${COMP_WORDS[COMP_CWORD]}"
    local prev="${COMP_WORDS[COMP_CWORD-1]}"
    local line=${COMP_LINE}
    local used=$(echo "$line" | grep -oE "\-[a-zA-Z]+ ")

    opts="-case -doc -fields -fileHandler -help -hostRoots -libs -mesh -noFunctionObjects -noOverwrite -overwrite -parallel -region -roots -srcDoc"
    for o in $used ; do opts="${opts/$o/}" ; done
    extra=""

    [ "$COMP_CWORD" = 1 ] || \
    case "$prev" in
        -case)
            opts="" ; extra="-d" ;;
        -fileHandler)
            opts="uncollated collated masterUncollated" ; extra="" ;;
        -hostRoots|-libs|-roots)
            opts="" ; extra="" ;;
        -mesh) opts="$(_mesh ${cur})" ;;
        -region) opts="$(_region ${cur})" ;;
       *) ;;
    esac
    COMPREPLY=( $(compgen -W "${opts}" $extra -- ${cur}) )
}
complete -o filenames -o nospace -F _mergeBaffles_ mergeBaffles

_mergeMeshes_ ()
{
    local cur="${COMP_WORDS[COMP_CWORD]}"
    local prev="${COMP_WORDS[COMP_CWORD-1]}"
    local line=${COMP_LINE}
    local used=$(echo "$line" | grep -oE "\-[a-zA-Z]+ ")

    opts="-addCaseMeshes -addCaseMeshRegions -addCaseRegions -addCases -addMeshes -addMeshRegions -addRegions -case -constant -doc -fileHandler -help -latestTime -libs -mesh -noFunctionObjects -noOverwrite -noZero -overwrite -region -srcDoc -time"
    for o in $used ; do opts="${opts/$o/}" ; done
    extra=""

    [ "$COMP_CWORD" = 1 ] || \
    case "$prev" in
        -case)
            opts="" ; extra="-d" ;;
        -fileHandler)
            opts="uncollated collated masterUncollated" ; extra="" ;;
        -time)
            opts="$(foamListTimes -withZero 2> /dev/null)" ; extra="" ;;
        -libs)
            opts="" ; extra="" ;;
        -mesh) opts="$(_mesh ${cur})" ;;
        -region) opts="$(_region ${cur})" ;;
       *) ;;
    esac
    COMPREPLY=( $(compgen -W "${opts}" $extra -- ${cur}) )
}
complete -o filenames -o nospace -F _mergeMeshes_ mergeMeshes

_mhdFoam_ ()
{
    local cur="${COMP_WORDS[COMP_CWORD]}"
    local prev="${COMP_WORDS[COMP_CWORD-1]}"
    local line=${COMP_LINE}
    local used=$(echo "$line" | grep -oE "\-[a-zA-Z]+ ")

    opts="-case -doc -fileHandler -help -hostRoots -libs -noFunctionObjects -parallel -postProcess -roots -srcDoc"
    for o in $used ; do opts="${opts/$o/}" ; done
    extra=""

    [ "$COMP_CWORD" = 1 ] || \
    case "$prev" in
        -case)
            opts="" ; extra="-d" ;;
        -fileHandler)
            opts="uncollated collated masterUncollated" ; extra="" ;;
        -hostRoots|-libs|-roots)
            opts="" ; extra="" ;;
       *) ;;
    esac
    COMPREPLY=( $(compgen -W "${opts}" $extra -- ${cur}) )
}
complete -o filenames -o nospace -F _mhdFoam_ mhdFoam

_mirrorMesh_ ()
{
    local cur="${COMP_WORDS[COMP_CWORD]}"
    local prev="${COMP_WORDS[COMP_CWORD-1]}"
    local line=${COMP_LINE}
    local used=$(echo "$line" | grep -oE "\-[a-zA-Z]+ ")

    opts="-case -dict -doc -fileHandler -help -hostRoots -libs -mesh -noFunctionObjects -noOverwrite -overwrite -parallel -region -roots -srcDoc"
    for o in $used ; do opts="${opts/$o/}" ; done
    extra=""

    [ "$COMP_CWORD" = 1 ] || \
    case "$prev" in
        -case)
            opts="" ; extra="-d" ;;
        -dict)
            opts="" ; extra="-d -f" ;;
        -fileHandler)
            opts="uncollated collated masterUncollated" ; extra="" ;;
        -hostRoots|-libs|-roots)
            opts="" ; extra="" ;;
        -mesh) opts="$(_mesh ${cur})" ;;
        -region) opts="$(_region ${cur})" ;;
       *) ;;
    esac
    COMPREPLY=( $(compgen -W "${opts}" $extra -- ${cur}) )
}
complete -o filenames -o nospace -F _mirrorMesh_ mirrorMesh

_mixtureAdiabaticFlameT_ ()
{
    local cur="${COMP_WORDS[COMP_CWORD]}"
    local prev="${COMP_WORDS[COMP_CWORD-1]}"
    local line=${COMP_LINE}
    local used=$(echo "$line" | grep -oE "\-[a-zA-Z]+ ")

    opts="-doc -help -srcDoc"
    for o in $used ; do opts="${opts/$o/}" ; done
    extra=""

    [ "$COMP_CWORD" = 1 ] || \
    case "$prev" in
       *) ;;
    esac
    COMPREPLY=( $(compgen -W "${opts}" $extra -- ${cur}) )
}
complete -o filenames -o nospace -F _mixtureAdiabaticFlameT_ mixtureAdiabaticFlameT

_mshToFoam_ ()
{
    local cur="${COMP_WORDS[COMP_CWORD]}"
    local prev="${COMP_WORDS[COMP_CWORD-1]}"
    local line=${COMP_LINE}
    local used=$(echo "$line" | grep -oE "\-[a-zA-Z]+ ")

    opts="-case -doc -fileHandler -help -hex -libs -noFunctionObjects -srcDoc"
    for o in $used ; do opts="${opts/$o/}" ; done
    extra="-d -f"

    [ "$COMP_CWORD" = 1 ] || \
    case "$prev" in
        -case)
            opts="" ; extra="-d" ;;
        -fileHandler)
            opts="uncollated collated masterUncollated" ; extra="" ;;
        -libs)
            opts="" ; extra="" ;;
       -*) ;;
        *)
            case "${COMP_WORDS[COMP_CWORD-2]}" in
                -libs|-case|-fileHandler) ;;
                *) opts=""; extra="" ;;
            esac
            ;;
    esac
    COMPREPLY=( $(compgen -W "${opts}" $extra -- ${cur}) )
}
complete -o filenames -o nospace -F _mshToFoam_ mshToFoam

_netgenNeutralToFoam_ ()
{
    local cur="${COMP_WORDS[COMP_CWORD]}"
    local prev="${COMP_WORDS[COMP_CWORD-1]}"
    local line=${COMP_LINE}
    local used=$(echo "$line" | grep -oE "\-[a-zA-Z]+ ")

    opts="-case -doc -fileHandler -help -hostRoots -libs -noFunctionObjects -parallel -roots -srcDoc"
    for o in $used ; do opts="${opts/$o/}" ; done
    extra="-d -f"

    [ "$COMP_CWORD" = 1 ] || \
    case "$prev" in
        -case)
            opts="" ; extra="-d" ;;
        -fileHandler)
            opts="uncollated collated masterUncollated" ; extra="" ;;
        -hostRoots|-libs|-roots)
            opts="" ; extra="" ;;
       -*) ;;
        *)
            case "${COMP_WORDS[COMP_CWORD-2]}" in
                -hostRoots|-libs|-roots|-case|-fileHandler) ;;
                *) opts=""; extra="" ;;
            esac
            ;;
    esac
    COMPREPLY=( $(compgen -W "${opts}" $extra -- ${cur}) )
}
complete -o filenames -o nospace -F _netgenNeutralToFoam_ netgenNeutralToFoam

_noise_ ()
{
    local cur="${COMP_WORDS[COMP_CWORD]}"
    local prev="${COMP_WORDS[COMP_CWORD-1]}"
    local line=${COMP_LINE}
    local used=$(echo "$line" | grep -oE "\-[a-zA-Z]+ ")

    opts="-case -dict -doc -fileHandler -help -libs -noFunctionObjects -srcDoc"
    for o in $used ; do opts="${opts/$o/}" ; done
    extra=""

    [ "$COMP_CWORD" = 1 ] || \
    case "$prev" in
        -case)
            opts="" ; extra="-d" ;;
        -dict)
            opts="" ; extra="-d -f" ;;
        -fileHandler)
            opts="uncollated collated masterUncollated" ; extra="" ;;
        -libs)
            opts="" ; extra="" ;;
       *) ;;
    esac
    COMPREPLY=( $(compgen -W "${opts}" $extra -- ${cur}) )
}
complete -o filenames -o nospace -F _noise_ noise

_objToVTK_ ()
{
    local cur="${COMP_WORDS[COMP_CWORD]}"
    local prev="${COMP_WORDS[COMP_CWORD-1]}"
    local line=${COMP_LINE}
    local used=$(echo "$line" | grep -oE "\-[a-zA-Z]+ ")

    opts="-doc -help -srcDoc"
    for o in $used ; do opts="${opts/$o/}" ; done
    extra="-d -f"

    [ "$COMP_CWORD" = 1 ] || \
    case "$prev" in
       -*) ;;
        *)
            opts=""; extra=""
            ;;
    esac
    COMPREPLY=( $(compgen -W "${opts}" $extra -- ${cur}) )
}
complete -o filenames -o nospace -F _objToVTK_ objToVTK

_particleTracks_ ()
{
    local cur="${COMP_WORDS[COMP_CWORD]}"
    local prev="${COMP_WORDS[COMP_CWORD-1]}"
    local line=${COMP_LINE}
    local used=$(echo "$line" | grep -oE "\-[a-zA-Z]+ ")

    opts="-case -constant -doc -fileHandler -help -hostRoots -latestTime -libs -noFunctionObjects -noZero -parallel -region -roots -srcDoc -time"
    for o in $used ; do opts="${opts/$o/}" ; done
    extra=""

    [ "$COMP_CWORD" = 1 ] || \
    case "$prev" in
        -case)
            opts="" ; extra="-d" ;;
        -fileHandler)
            opts="uncollated collated masterUncollated" ; extra="" ;;
        -time)
            opts="$(foamListTimes -withZero 2> /dev/null)" ; extra="" ;;
        -hostRoots|-libs|-roots)
            opts="" ; extra="" ;;
        -region) opts="$(_region ${cur})" ;;
       *) ;;
    esac
    COMPREPLY=( $(compgen -W "${opts}" $extra -- ${cur}) )
}
complete -o filenames -o nospace -F _particleTracks_ particleTracks

_patchSummary_ ()
{
    local cur="${COMP_WORDS[COMP_CWORD]}"
    local prev="${COMP_WORDS[COMP_CWORD-1]}"
    local line=${COMP_LINE}
    local used=$(echo "$line" | grep -oE "\-[a-zA-Z]+ ")

    opts="-case -constant -doc -expand -fileHandler -help -hostRoots -latestTime -libs -mesh -noFunctionObjects -noZero -parallel -region -roots -srcDoc -time"
    for o in $used ; do opts="${opts/$o/}" ; done
    extra=""

    [ "$COMP_CWORD" = 1 ] || \
    case "$prev" in
        -case)
            opts="" ; extra="-d" ;;
        -fileHandler)
            opts="uncollated collated masterUncollated" ; extra="" ;;
        -time)
            opts="$(foamListTimes -withZero 2> /dev/null)" ; extra="" ;;
        -hostRoots|-libs|-roots)
            opts="" ; extra="" ;;
        -mesh) opts="$(_mesh ${cur})" ;;
        -region) opts="$(_region ${cur})" ;;
       *) ;;
    esac
    COMPREPLY=( $(compgen -W "${opts}" $extra -- ${cur}) )
}
complete -o filenames -o nospace -F _patchSummary_ patchSummary

_pdfPlot_ ()
{
    local cur="${COMP_WORDS[COMP_CWORD]}"
    local prev="${COMP_WORDS[COMP_CWORD-1]}"
    local line=${COMP_LINE}
    local used=$(echo "$line" | grep -oE "\-[a-zA-Z]+ ")

    opts="-case -doc -fileHandler -help -hostRoots -libs -noFunctionObjects -parallel -roots -srcDoc"
    for o in $used ; do opts="${opts/$o/}" ; done
    extra=""

    [ "$COMP_CWORD" = 1 ] || \
    case "$prev" in
        -case)
            opts="" ; extra="-d" ;;
        -fileHandler)
            opts="uncollated collated masterUncollated" ; extra="" ;;
        -hostRoots|-libs|-roots)
            opts="" ; extra="" ;;
       *) ;;
    esac
    COMPREPLY=( $(compgen -W "${opts}" $extra -- ${cur}) )
}
complete -o filenames -o nospace -F _pdfPlot_ pdfPlot

_PDRFoam_ ()
{
    local cur="${COMP_WORDS[COMP_CWORD]}"
    local prev="${COMP_WORDS[COMP_CWORD-1]}"
    local line=${COMP_LINE}
    local used=$(echo "$line" | grep -oE "\-[a-zA-Z]+ ")

    opts="-case -doc -fileHandler -help -hostRoots -libs -noFunctionObjects -parallel -postProcess -roots -srcDoc"
    for o in $used ; do opts="${opts/$o/}" ; done
    extra=""

    [ "$COMP_CWORD" = 1 ] || \
    case "$prev" in
        -case)
            opts="" ; extra="-d" ;;
        -fileHandler)
            opts="uncollated collated masterUncollated" ; extra="" ;;
        -hostRoots|-libs|-roots)
            opts="" ; extra="" ;;
       *) ;;
    esac
    COMPREPLY=( $(compgen -W "${opts}" $extra -- ${cur}) )
}
complete -o filenames -o nospace -F _PDRFoam_ PDRFoam

_plot3dToFoam_ ()
{
    local cur="${COMP_WORDS[COMP_CWORD]}"
    local prev="${COMP_WORDS[COMP_CWORD-1]}"
    local line=${COMP_LINE}
    local used=$(echo "$line" | grep -oE "\-[a-zA-Z]+ ")

    opts="-2D -case -doc -fileHandler -help -libs -noBlank -noFunctionObjects -scale -singleBlock -srcDoc"
    for o in $used ; do opts="${opts/$o/}" ; done
    extra="-d -f"

    [ "$COMP_CWORD" = 1 ] || \
    case "$prev" in
        -case)
            opts="" ; extra="-d" ;;
        -fileHandler)
            opts="uncollated collated masterUncollated" ; extra="" ;;
        -2D|-libs|-scale)
            opts="" ; extra="" ;;
       -*) ;;
        *)
            case "${COMP_WORDS[COMP_CWORD-2]}" in
                -2D|-libs|-scale|-case|-fileHandler) ;;
                *) opts=""; extra="" ;;
            esac
            ;;
    esac
    COMPREPLY=( $(compgen -W "${opts}" $extra -- ${cur}) )
}
complete -o filenames -o nospace -F _plot3dToFoam_ plot3dToFoam

_polyDualMesh_ ()
{
    local cur="${COMP_WORDS[COMP_CWORD]}"
    local prev="${COMP_WORDS[COMP_CWORD-1]}"
    local line=${COMP_LINE}
    local used=$(echo "$line" | grep -oE "\-[a-zA-Z]+ ")

    opts="-case -concaveMultiCells -doc -doNotPreserveFaceZones -fileHandler -help -libs -mesh -noFunctionObjects -noOverwrite -overwrite -region -splitAllFaces -srcDoc"
    for o in $used ; do opts="${opts/$o/}" ; done
    extra=""

    [ "$COMP_CWORD" = 1 ] || \
    case "$prev" in
        -case)
            opts="" ; extra="-d" ;;
        -fileHandler)
            opts="uncollated collated masterUncollated" ; extra="" ;;
        -libs)
            opts="" ; extra="" ;;
        -mesh) opts="$(_mesh ${cur})" ;;
        -region) opts="$(_region ${cur})" ;;
       *) ;;
    esac
    COMPREPLY=( $(compgen -W "${opts}" $extra -- ${cur}) )
}
complete -o filenames -o nospace -F _polyDualMesh_ polyDualMesh

_porousSimpleFoam_ ()
{
    local cur="${COMP_WORDS[COMP_CWORD]}"
    local prev="${COMP_WORDS[COMP_CWORD-1]}"
    local line=${COMP_LINE}
    local used=$(echo "$line" | grep -oE "\-[a-zA-Z]+ ")

    opts="-case -doc -fileHandler -help -hostRoots -libs -noFunctionObjects -parallel -postProcess -roots -srcDoc"
    for o in $used ; do opts="${opts/$o/}" ; done
    extra=""

    [ "$COMP_CWORD" = 1 ] || \
    case "$prev" in
        -case)
            opts="" ; extra="-d" ;;
        -fileHandler)
            opts="uncollated collated masterUncollated" ; extra="" ;;
        -hostRoots|-libs|-roots)
            opts="" ; extra="" ;;
       *) ;;
    esac
    COMPREPLY=( $(compgen -W "${opts}" $extra -- ${cur}) )
}
complete -o filenames -o nospace -F _porousSimpleFoam_ porousSimpleFoam

_potentialFoam_ ()
{
    local cur="${COMP_WORDS[COMP_CWORD]}"
    local prev="${COMP_WORDS[COMP_CWORD-1]}"
    local line=${COMP_LINE}
    local used=$(echo "$line" | grep -oE "\-[a-zA-Z]+ ")

    opts="-case -doc -fileHandler -functionObjects -help -hostRoots -initialiseUBCs -libs -parallel -pName -roots -srcDoc -writep -writePhi"
    for o in $used ; do opts="${opts/$o/}" ; done
    extra=""

    [ "$COMP_CWORD" = 1 ] || \
    case "$prev" in
        -case)
            opts="" ; extra="-d" ;;
        -fileHandler)
            opts="uncollated collated masterUncollated" ; extra="" ;;
        -hostRoots|-libs|-pName|-roots)
            opts="" ; extra="" ;;
       *) ;;
    esac
    COMPREPLY=( $(compgen -W "${opts}" $extra -- ${cur}) )
}
complete -o filenames -o nospace -F _potentialFoam_ potentialFoam

_reconstructPar_ ()
{
    local cur="${COMP_WORDS[COMP_CWORD]}"
    local prev="${COMP_WORDS[COMP_CWORD-1]}"
    local line=${COMP_LINE}
    local used=$(echo "$line" | grep -oE "\-[a-zA-Z]+ ")

    opts="- -allRegions -case -cellProc -constant -doc -fields -fileHandler -help -lagrangianFields -latestTime -libs -mesh -newTimes -noFields -noFunctionObjects -noLagrangian -noSets -noZero -region -rm -srcDoc -time -withZero"
    for o in $used ; do opts="${opts/$o/}" ; done
    extra=""

    [ "$COMP_CWORD" = 1 ] || \
    case "$prev" in
        -case)
            opts="" ; extra="-d" ;;
        -fileHandler)
            opts="uncollated collated masterUncollated" ; extra="" ;;
        -time)
            opts="$(foamListTimes -withZero 2> /dev/null)" ; extra="" ;;
        -fields|-lagrangianFields|-libs)
            opts="" ; extra="" ;;
        -mesh) opts="$(_mesh ${cur})" ;;
        -region) opts="$(_region ${cur})" ;;
       *) ;;
    esac
    COMPREPLY=( $(compgen -W "${opts}" $extra -- ${cur}) )
}
complete -o filenames -o nospace -F _reconstructPar_ reconstructPar

_redistributePar_ ()
{
    local cur="${COMP_WORDS[COMP_CWORD]}"
    local prev="${COMP_WORDS[COMP_CWORD-1]}"
    local line=${COMP_LINE}
    local used=$(echo "$line" | grep -oE "\-[a-zA-Z]+ ")

    opts="-case -constant -doc -fileHandler -help -hostRoots -latestTime -libs -mesh -noFunctionObjects -noOverwrite -noZero -overwrite -parallel -region -roots -srcDoc -time"
    for o in $used ; do opts="${opts/$o/}" ; done
    extra=""

    [ "$COMP_CWORD" = 1 ] || \
    case "$prev" in
        -case)
            opts="" ; extra="-d" ;;
        -fileHandler)
            opts="uncollated collated masterUncollated" ; extra="" ;;
        -time)
            opts="$(foamListTimes -withZero 2> /dev/null)" ; extra="" ;;
        -hostRoots|-libs|-roots)
            opts="" ; extra="" ;;
        -mesh) opts="$(_mesh ${cur})" ;;
        -region) opts="$(_region ${cur})" ;;
       *) ;;
    esac
    COMPREPLY=( $(compgen -W "${opts}" $extra -- ${cur}) )
}
complete -o filenames -o nospace -F _redistributePar_ redistributePar

_refinementLevel_ ()
{
    local cur="${COMP_WORDS[COMP_CWORD]}"
    local prev="${COMP_WORDS[COMP_CWORD-1]}"
    local line=${COMP_LINE}
    local used=$(echo "$line" | grep -oE "\-[a-zA-Z]+ ")

    opts="-case -doc -fileHandler -help -hostRoots -libs -noFunctionObjects -parallel -readLevel -roots -srcDoc"
    for o in $used ; do opts="${opts/$o/}" ; done
    extra=""

    [ "$COMP_CWORD" = 1 ] || \
    case "$prev" in
        -case)
            opts="" ; extra="-d" ;;
        -fileHandler)
            opts="uncollated collated masterUncollated" ; extra="" ;;
        -hostRoots|-libs|-roots)
            opts="" ; extra="" ;;
       *) ;;
    esac
    COMPREPLY=( $(compgen -W "${opts}" $extra -- ${cur}) )
}
complete -o filenames -o nospace -F _refinementLevel_ refinementLevel

_refineMesh_ ()
{
    local cur="${COMP_WORDS[COMP_CWORD]}"
    local prev="${COMP_WORDS[COMP_CWORD-1]}"
    local line=${COMP_LINE}
    local used=$(echo "$line" | grep -oE "\-[a-zA-Z]+ ")

    opts="-all -case -dict -doc -fileHandler -help -hostRoots -libs -mesh -noFunctionObjects -noOverwrite -overwrite -parallel -region -roots -srcDoc"
    for o in $used ; do opts="${opts/$o/}" ; done
    extra=""

    [ "$COMP_CWORD" = 1 ] || \
    case "$prev" in
        -case)
            opts="" ; extra="-d" ;;
        -dict)
            opts="" ; extra="-d -f" ;;
        -fileHandler)
            opts="uncollated collated masterUncollated" ; extra="" ;;
        -hostRoots|-libs|-roots)
            opts="" ; extra="" ;;
        -mesh) opts="$(_mesh ${cur})" ;;
        -region) opts="$(_region ${cur})" ;;
       *) ;;
    esac
    COMPREPLY=( $(compgen -W "${opts}" $extra -- ${cur}) )
}
complete -o filenames -o nospace -F _refineMesh_ refineMesh

_refineWallLayer_ ()
{
    local cur="${COMP_WORDS[COMP_CWORD]}"
    local prev="${COMP_WORDS[COMP_CWORD-1]}"
    local line=${COMP_LINE}
    local used=$(echo "$line" | grep -oE "\-[a-zA-Z]+ ")

    opts="-case -doc -fileHandler -help -inSet -libs -noFunctionObjects -noOverwrite -overwrite -region -srcDoc"
    for o in $used ; do opts="${opts/$o/}" ; done
    extra=""

    [ "$COMP_CWORD" = 1 ] || \
    case "$prev" in
        -case)
            opts="" ; extra="-d" ;;
        -fileHandler)
            opts="uncollated collated masterUncollated" ; extra="" ;;
        -inSet|-libs)
            opts="" ; extra="" ;;
        -region) opts="$(_region ${cur})" ;;
       *) ;;
    esac
    COMPREPLY=( $(compgen -W "${opts}" $extra -- ${cur}) )
}
complete -o filenames -o nospace -F _refineWallLayer_ refineWallLayer

_removeFaces_ ()
{
    local cur="${COMP_WORDS[COMP_CWORD]}"
    local prev="${COMP_WORDS[COMP_CWORD-1]}"
    local line=${COMP_LINE}
    local used=$(echo "$line" | grep -oE "\-[a-zA-Z]+ ")

    opts="-case -doc -fileHandler -help -hostRoots -libs -mesh -noFields -noFunctionObjects -noOverwrite -overwrite -parallel -region -roots -srcDoc"
    for o in $used ; do opts="${opts/$o/}" ; done
    extra=""

    [ "$COMP_CWORD" = 1 ] || \
    case "$prev" in
        -case)
            opts="" ; extra="-d" ;;
        -fileHandler)
            opts="uncollated collated masterUncollated" ; extra="" ;;
        -hostRoots|-libs|-roots)
            opts="" ; extra="" ;;
        -mesh) opts="$(_mesh ${cur})" ;;
        -region) opts="$(_region ${cur})" ;;
       *) ;;
    esac
    COMPREPLY=( $(compgen -W "${opts}" $extra -- ${cur}) )
}
complete -o filenames -o nospace -F _removeFaces_ removeFaces

_renumberMesh_ ()
{
    local cur="${COMP_WORDS[COMP_CWORD]}"
    local prev="${COMP_WORDS[COMP_CWORD-1]}"
    local line=${COMP_LINE}
    local used=$(echo "$line" | grep -oE "\-[a-zA-Z]+ ")

    opts="-case -constant -dict -doc -fileHandler -frontWidth -help -hostRoots -latestTime -libs -mesh -noFields -noFunctionObjects -noOverwrite -noZero -overwrite -parallel -region -roots -srcDoc -time"
    for o in $used ; do opts="${opts/$o/}" ; done
    extra=""

    [ "$COMP_CWORD" = 1 ] || \
    case "$prev" in
        -case)
            opts="" ; extra="-d" ;;
        -dict)
            opts="" ; extra="-d -f" ;;
        -fileHandler)
            opts="uncollated collated masterUncollated" ; extra="" ;;
        -time)
            opts="$(foamListTimes -withZero 2> /dev/null)" ; extra="" ;;
        -hostRoots|-libs|-roots)
            opts="" ; extra="" ;;
        -mesh) opts="$(_mesh ${cur})" ;;
        -region) opts="$(_region ${cur})" ;;
       *) ;;
    esac
    COMPREPLY=( $(compgen -W "${opts}" $extra -- ${cur}) )
}
complete -o filenames -o nospace -F _renumberMesh_ renumberMesh

_reorderPatches_ ()
{
    local cur="${COMP_WORDS[COMP_CWORD]}"
    local prev="${COMP_WORDS[COMP_CWORD-1]}"
    local line=${COMP_LINE}
    local used=$(echo "$line" | grep -oE "\-[a-zA-Z]+ ")

    opts="-case -constant -doc -fileHandler -help -hostRoots -latestTime -libs -mesh -noFunctionObjects -noOverwrite -noZero -overwrite -parallel -patchOrder -referenceCase -referenceMesh -referenceRegion -region -roots -srcDoc -time"
    for o in $used ; do opts="${opts/$o/}" ; done
    extra=""

    [ "$COMP_CWORD" = 1 ] || \
    case "$prev" in
        -case)
            opts="" ; extra="-d" ;;
        -fileHandler)
            opts="uncollated collated masterUncollated" ; extra="" ;;
        -time)
            opts="$(foamListTimes -withZero 2> /dev/null)" ; extra="" ;;
        -hostRoots|-libs|-patchOrder|-referenceCase|-referenceMesh|-referenceRegion|-roots)
            opts="" ; extra="" ;;
        -mesh) opts="$(_mesh ${cur})" ;;
        -region) opts="$(_region ${cur})" ;;
       *) ;;
    esac
    COMPREPLY=( $(compgen -W "${opts}" $extra -- ${cur}) )
}
complete -o filenames -o nospace -F _reorderPatches_ reorderPatches

_rhoPorousSimpleFoam_ ()
{
    local cur="${COMP_WORDS[COMP_CWORD]}"
    local prev="${COMP_WORDS[COMP_CWORD-1]}"
    local line=${COMP_LINE}
    local used=$(echo "$line" | grep -oE "\-[a-zA-Z]+ ")

    opts="-case -doc -fileHandler -help -hostRoots -libs -noFunctionObjects -parallel -postProcess -roots -srcDoc"
    for o in $used ; do opts="${opts/$o/}" ; done
    extra=""

    [ "$COMP_CWORD" = 1 ] || \
    case "$prev" in
        -case)
            opts="" ; extra="-d" ;;
        -fileHandler)
            opts="uncollated collated masterUncollated" ; extra="" ;;
        -hostRoots|-libs|-roots)
            opts="" ; extra="" ;;
       *) ;;
    esac
    COMPREPLY=( $(compgen -W "${opts}" $extra -- ${cur}) )
}
complete -o filenames -o nospace -F _rhoPorousSimpleFoam_ rhoPorousSimpleFoam

_sammToFoam_ ()
{
    local cur="${COMP_WORDS[COMP_CWORD]}"
    local prev="${COMP_WORDS[COMP_CWORD-1]}"
    local line=${COMP_LINE}
    local used=$(echo "$line" | grep -oE "\-[a-zA-Z]+ ")

    opts="-case -doc -fileHandler -help -libs -noFunctionObjects -scale -srcDoc"
    for o in $used ; do opts="${opts/$o/}" ; done
    extra=""

    [ "$COMP_CWORD" = 1 ] || \
    case "$prev" in
        -case)
            opts="" ; extra="-d" ;;
        -fileHandler)
            opts="uncollated collated masterUncollated" ; extra="" ;;
        -libs|-scale)
            opts="" ; extra="" ;;
       *) ;;
    esac
    COMPREPLY=( $(compgen -W "${opts}" $extra -- ${cur}) )
}
complete -o filenames -o nospace -F _sammToFoam_ sammToFoam

_selectCells_ ()
{
    local cur="${COMP_WORDS[COMP_CWORD]}"
    local prev="${COMP_WORDS[COMP_CWORD-1]}"
    local line=${COMP_LINE}
    local used=$(echo "$line" | grep -oE "\-[a-zA-Z]+ ")

    opts="-case -doc -fileHandler -help -libs -noFunctionObjects -srcDoc"
    for o in $used ; do opts="${opts/$o/}" ; done
    extra=""

    [ "$COMP_CWORD" = 1 ] || \
    case "$prev" in
        -case)
            opts="" ; extra="-d" ;;
        -fileHandler)
            opts="uncollated collated masterUncollated" ; extra="" ;;
        -libs)
            opts="" ; extra="" ;;
       *) ;;
    esac
    COMPREPLY=( $(compgen -W "${opts}" $extra -- ${cur}) )
}
complete -o filenames -o nospace -F _selectCells_ selectCells

_setAtmBoundaryLayer_ ()
{
    local cur="${COMP_WORDS[COMP_CWORD]}"
    local prev="${COMP_WORDS[COMP_CWORD-1]}"
    local line=${COMP_LINE}
    local used=$(echo "$line" | grep -oE "\-[a-zA-Z]+ ")

    opts="-case -dict -doc -fileHandler -help -hostRoots -latestTime -libs -noFunctionObjects -noZero -parallel -region -roots -srcDoc -time"
    for o in $used ; do opts="${opts/$o/}" ; done
    extra=""

    [ "$COMP_CWORD" = 1 ] || \
    case "$prev" in
        -case)
            opts="" ; extra="-d" ;;
        -dict)
            opts="" ; extra="-d -f" ;;
        -fileHandler)
            opts="uncollated collated masterUncollated" ; extra="" ;;
        -time)
            opts="$(foamListTimes -withZero 2> /dev/null)" ; extra="" ;;
        -hostRoots|-libs|-roots)
            opts="" ; extra="" ;;
        -region) opts="$(_region ${cur})" ;;
       *) ;;
    esac
    COMPREPLY=( $(compgen -W "${opts}" $extra -- ${cur}) )
}
complete -o filenames -o nospace -F _setAtmBoundaryLayer_ setAtmBoundaryLayer

_setFields_ ()
{
    local cur="${COMP_WORDS[COMP_CWORD]}"
    local prev="${COMP_WORDS[COMP_CWORD-1]}"
    local line=${COMP_LINE}
    local used=$(echo "$line" | grep -oE "\-[a-zA-Z]+ ")

    opts="-case -constant -dict -doc -fileHandler -help -hostRoots -latestTime -libs -noFunctionObjects -noZero -parallel -region -roots -srcDoc -time"
    for o in $used ; do opts="${opts/$o/}" ; done
    extra=""

    [ "$COMP_CWORD" = 1 ] || \
    case "$prev" in
        -case)
            opts="" ; extra="-d" ;;
        -dict)
            opts="" ; extra="-d -f" ;;
        -fileHandler)
            opts="uncollated collated masterUncollated" ; extra="" ;;
        -time)
            opts="$(foamListTimes -withZero 2> /dev/null)" ; extra="" ;;
        -hostRoots|-libs|-roots)
            opts="" ; extra="" ;;
        -region) opts="$(_region ${cur})" ;;
       *) ;;
    esac
    COMPREPLY=( $(compgen -W "${opts}" $extra -- ${cur}) )
}
complete -o filenames -o nospace -F _setFields_ setFields

_setWaves_ ()
{
    local cur="${COMP_WORDS[COMP_CWORD]}"
    local prev="${COMP_WORDS[COMP_CWORD-1]}"
    local line=${COMP_LINE}
    local used=$(echo "$line" | grep -oE "\-[a-zA-Z]+ ")

    opts="-alpha -case -dict -doc -fileHandler -gas -help -hostRoots -latestTime -libs -noFunctionObjects -noZero -parallel -region -roots -srcDoc -time -U"
    for o in $used ; do opts="${opts/$o/}" ; done
    extra=""

    [ "$COMP_CWORD" = 1 ] || \
    case "$prev" in
        -case)
            opts="" ; extra="-d" ;;
        -dict)
            opts="" ; extra="-d -f" ;;
        -fileHandler)
            opts="uncollated collated masterUncollated" ; extra="" ;;
        -time)
            opts="$(foamListTimes -withZero 2> /dev/null)" ; extra="" ;;
        -U|-alpha|-hostRoots|-libs|-roots)
            opts="" ; extra="" ;;
        -region) opts="$(_region ${cur})" ;;
       *) ;;
    esac
    COMPREPLY=( $(compgen -W "${opts}" $extra -- ${cur}) )
}
complete -o filenames -o nospace -F _setWaves_ setWaves

_shallowWaterFoam_ ()
{
    local cur="${COMP_WORDS[COMP_CWORD]}"
    local prev="${COMP_WORDS[COMP_CWORD-1]}"
    local line=${COMP_LINE}
    local used=$(echo "$line" | grep -oE "\-[a-zA-Z]+ ")

    opts="-case -doc -fileHandler -help -hostRoots -libs -noFunctionObjects -parallel -postProcess -roots -srcDoc"
    for o in $used ; do opts="${opts/$o/}" ; done
    extra=""

    [ "$COMP_CWORD" = 1 ] || \
    case "$prev" in
        -case)
            opts="" ; extra="-d" ;;
        -fileHandler)
            opts="uncollated collated masterUncollated" ; extra="" ;;
        -hostRoots|-libs|-roots)
            opts="" ; extra="" ;;
       *) ;;
    esac
    COMPREPLY=( $(compgen -W "${opts}" $extra -- ${cur}) )
}
complete -o filenames -o nospace -F _shallowWaterFoam_ shallowWaterFoam

_singleCellMesh_ ()
{
    local cur="${COMP_WORDS[COMP_CWORD]}"
    local prev="${COMP_WORDS[COMP_CWORD-1]}"
    local line=${COMP_LINE}
    local used=$(echo "$line" | grep -oE "\-[a-zA-Z]+ ")

    opts="-case -constant -doc -fileHandler -help -hostRoots -latestTime -libs -mesh -noFields -noFunctionObjects -noZero -parallel -roots -srcDoc -time"
    for o in $used ; do opts="${opts/$o/}" ; done
    extra=""

    [ "$COMP_CWORD" = 1 ] || \
    case "$prev" in
        -case)
            opts="" ; extra="-d" ;;
        -fileHandler)
            opts="uncollated collated masterUncollated" ; extra="" ;;
        -time)
            opts="$(foamListTimes -withZero 2> /dev/null)" ; extra="" ;;
        -hostRoots|-libs|-roots)
            opts="" ; extra="" ;;
        -mesh) opts="$(_mesh ${cur})" ;;
       *) ;;
    esac
    COMPREPLY=( $(compgen -W "${opts}" $extra -- ${cur}) )
}
complete -o filenames -o nospace -F _singleCellMesh_ singleCellMesh

_smapToFoam_ ()
{
    local cur="${COMP_WORDS[COMP_CWORD]}"
    local prev="${COMP_WORDS[COMP_CWORD-1]}"
    local line=${COMP_LINE}
    local used=$(echo "$line" | grep -oE "\-[a-zA-Z]+ ")

    opts="-case -doc -fileHandler -help -libs -noFunctionObjects -srcDoc"
    for o in $used ; do opts="${opts/$o/}" ; done
    extra="-d -f"

    [ "$COMP_CWORD" = 1 ] || \
    case "$prev" in
        -case)
            opts="" ; extra="-d" ;;
        -fileHandler)
            opts="uncollated collated masterUncollated" ; extra="" ;;
        -libs)
            opts="" ; extra="" ;;
       -*) ;;
        *)
            case "${COMP_WORDS[COMP_CWORD-2]}" in
                -libs|-case|-fileHandler) ;;
                *) opts=""; extra="" ;;
            esac
            ;;
    esac
    COMPREPLY=( $(compgen -W "${opts}" $extra -- ${cur}) )
}
complete -o filenames -o nospace -F _smapToFoam_ smapToFoam

_snappyHexMesh_ ()
{
    local cur="${COMP_WORDS[COMP_CWORD]}"
    local prev="${COMP_WORDS[COMP_CWORD-1]}"
    local line=${COMP_LINE}
    local used=$(echo "$line" | grep -oE "\-[a-zA-Z]+ ")

    opts="-case -checkGeometry -dict -doc -fileHandler -help -hostRoots -libs -mesh -noOverwrite -outFile -overwrite -parallel -patches -region -roots -srcDoc -surfaceSimplify"
    for o in $used ; do opts="${opts/$o/}" ; done
    extra=""

    [ "$COMP_CWORD" = 1 ] || \
    case "$prev" in
        -case)
            opts="" ; extra="-d" ;;
        -dict|-outFile)
            opts="" ; extra="-d -f" ;;
        -fileHandler)
            opts="uncollated collated masterUncollated" ; extra="" ;;
        -hostRoots|-libs|-patches|-roots|-surfaceSimplify)
            opts="" ; extra="" ;;
        -mesh) opts="$(_mesh ${cur})" ;;
        -region) opts="$(_region ${cur})" ;;
       *) ;;
    esac
    COMPREPLY=( $(compgen -W "${opts}" $extra -- ${cur}) )
}
complete -o filenames -o nospace -F _snappyHexMesh_ snappyHexMesh

_snappyHexMeshConfig_ ()
{
    local cur="${COMP_WORDS[COMP_CWORD]}"
    local prev="${COMP_WORDS[COMP_CWORD-1]}"
    local line=${COMP_LINE}
    local used=$(echo "$line" | grep -oE "\-[a-zA-Z]+ ")

    opts="-baffles -bounds -cellZones -clearBoundary -closedDomain -cylindricalBackground -defaultPatch -doc -explicitFeatures -firstLayerThickness -help -inletRegions -insidePoint -insidePoints -layerExpansionRatio -layers -minDimCells -nCells -nCellsBetweenLevels -noBackground -outletRegions -refineBackground -refinementBoxes -refinementDists -refinementLevel -refinementRegions -region -rm -rotatingZones -srcDoc -surface -surfaceLevels -xMaxPatch -xMinPatch -yMaxPatch -yMinPatch -zMaxPatch -zMinPatch"
    for o in $used ; do opts="${opts/$o/}" ; done
    extra=""

    [ "$COMP_CWORD" = 1 ] || \
    case "$prev" in
        -surface)
            opts="" ; extra="-d -f" ;;
        -baffles|-bounds|-cellZones|-defaultPatch|-firstLayerThickness|-inletRegions|-insidePoint|-insidePoints|-layerExpansionRatio|-layers|-minDimCells|-nCells|-nCellsBetweenLevels|-outletRegions|-refineBackground|-refinementBoxes|-refinementDists|-refinementLevel|-refinementRegions|-rotatingZones|-surfaceLevels|-xMaxPatch|-xMinPatch|-yMaxPatch|-yMinPatch|-zMaxPatch|-zMinPatch)
            opts="" ; extra="" ;;
        -region) opts="$(_region ${cur})" ;;
       *) ;;
    esac
    COMPREPLY=( $(compgen -W "${opts}" $extra -- ${cur}) )
}
complete -o filenames -o nospace -F _snappyHexMeshConfig_ snappyHexMeshConfig

_splitBaffles_ ()
{
    local cur="${COMP_WORDS[COMP_CWORD]}"
    local prev="${COMP_WORDS[COMP_CWORD-1]}"
    local line=${COMP_LINE}
    local used=$(echo "$line" | grep -oE "\-[a-zA-Z]+ ")

    opts="-case -doc -fields -fileHandler -help -hostRoots -libs -mesh -noFunctionObjects -noOverwrite -overwrite -parallel -region -roots -srcDoc"
    for o in $used ; do opts="${opts/$o/}" ; done
    extra=""

    [ "$COMP_CWORD" = 1 ] || \
    case "$prev" in
        -case)
            opts="" ; extra="-d" ;;
        -fileHandler)
            opts="uncollated collated masterUncollated" ; extra="" ;;
        -hostRoots|-libs|-roots)
            opts="" ; extra="" ;;
        -mesh) opts="$(_mesh ${cur})" ;;
        -region) opts="$(_region ${cur})" ;;
       *) ;;
    esac
    COMPREPLY=( $(compgen -W "${opts}" $extra -- ${cur}) )
}
complete -o filenames -o nospace -F _splitBaffles_ splitBaffles

_splitCells_ ()
{
    local cur="${COMP_WORDS[COMP_CWORD]}"
    local prev="${COMP_WORDS[COMP_CWORD-1]}"
    local line=${COMP_LINE}
    local used=$(echo "$line" | grep -oE "\-[a-zA-Z]+ ")

    opts="-case -doc -fileHandler -geometry -help -libs -noFunctionObjects -noOverwrite -overwrite -set -srcDoc -tol"
    for o in $used ; do opts="${opts/$o/}" ; done
    extra=""

    [ "$COMP_CWORD" = 1 ] || \
    case "$prev" in
        -case)
            opts="" ; extra="-d" ;;
        -fileHandler)
            opts="uncollated collated masterUncollated" ; extra="" ;;
        -libs|-set|-tol)
            opts="" ; extra="" ;;
       *) ;;
    esac
    COMPREPLY=( $(compgen -W "${opts}" $extra -- ${cur}) )
}
complete -o filenames -o nospace -F _splitCells_ splitCells

_splitMeshRegions_ ()
{
    local cur="${COMP_WORDS[COMP_CWORD]}"
    local prev="${COMP_WORDS[COMP_CWORD-1]}"
    local line=${COMP_LINE}
    local used=$(echo "$line" | grep -oE "\-[a-zA-Z]+ ")

    opts="-blockedFaces -case -cellZones -cellZonesFileOnly -cellZonesOnly -defaultRegionName -detectOnly -doc -fileHandler -help -hostRoots -insidePoint -largestOnly -libs -makeCellZones -mesh -noFields -noFunctionObjects -noOverwrite -overwrite -parallel -prefixRegion -region -roots -sloppyCellZones -srcDoc -useFaceZones"
    for o in $used ; do opts="${opts/$o/}" ; done
    extra=""

    [ "$COMP_CWORD" = 1 ] || \
    case "$prev" in
        -case)
            opts="" ; extra="-d" ;;
        -cellZonesFileOnly)
            opts="" ; extra="-d -f" ;;
        -fileHandler)
            opts="uncollated collated masterUncollated" ; extra="" ;;
        -blockedFaces|-defaultRegionName|-hostRoots|-insidePoint|-libs|-roots)
            opts="" ; extra="" ;;
        -mesh) opts="$(_mesh ${cur})" ;;
        -region) opts="$(_region ${cur})" ;;
       *) ;;
    esac
    COMPREPLY=( $(compgen -W "${opts}" $extra -- ${cur}) )
}
complete -o filenames -o nospace -F _splitMeshRegions_ splitMeshRegions

_star3ToFoam_ ()
{
    local cur="${COMP_WORDS[COMP_CWORD]}"
    local prev="${COMP_WORDS[COMP_CWORD-1]}"
    local line=${COMP_LINE}
    local used=$(echo "$line" | grep -oE "\-[a-zA-Z]+ ")

    opts="-case -doc -fileHandler -help -libs -noFunctionObjects -scale -srcDoc"
    for o in $used ; do opts="${opts/$o/}" ; done
    extra=""

    [ "$COMP_CWORD" = 1 ] || \
    case "$prev" in
        -case)
            opts="" ; extra="-d" ;;
        -fileHandler)
            opts="uncollated collated masterUncollated" ; extra="" ;;
        -libs|-scale)
            opts="" ; extra="" ;;
       *) ;;
    esac
    COMPREPLY=( $(compgen -W "${opts}" $extra -- ${cur}) )
}
complete -o filenames -o nospace -F _star3ToFoam_ star3ToFoam

_star4ToFoam_ ()
{
    local cur="${COMP_WORDS[COMP_CWORD]}"
    local prev="${COMP_WORDS[COMP_CWORD-1]}"
    local line=${COMP_LINE}
    local used=$(echo "$line" | grep -oE "\-[a-zA-Z]+ ")

    opts="-ascii -case -doc -fileHandler -help -libs -noFunctionObjects -scale -solids -srcDoc"
    for o in $used ; do opts="${opts/$o/}" ; done
    extra=""

    [ "$COMP_CWORD" = 1 ] || \
    case "$prev" in
        -case)
            opts="" ; extra="-d" ;;
        -fileHandler)
            opts="uncollated collated masterUncollated" ; extra="" ;;
        -libs|-scale)
            opts="" ; extra="" ;;
       *) ;;
    esac
    COMPREPLY=( $(compgen -W "${opts}" $extra -- ${cur}) )
}
complete -o filenames -o nospace -F _star4ToFoam_ star4ToFoam

_steadyParticleTracks_ ()
{
    local cur="${COMP_WORDS[COMP_CWORD]}"
    local prev="${COMP_WORDS[COMP_CWORD-1]}"
    local line=${COMP_LINE}
    local used=$(echo "$line" | grep -oE "\-[a-zA-Z]+ ")

    opts="-case -constant -dict -doc -fileHandler -help -latestTime -libs -noFunctionObjects -noZero -region -srcDoc -time"
    for o in $used ; do opts="${opts/$o/}" ; done
    extra=""

    [ "$COMP_CWORD" = 1 ] || \
    case "$prev" in
        -case)
            opts="" ; extra="-d" ;;
        -dict)
            opts="" ; extra="-d -f" ;;
        -fileHandler)
            opts="uncollated collated masterUncollated" ; extra="" ;;
        -time)
            opts="$(foamListTimes -withZero 2> /dev/null)" ; extra="" ;;
        -libs)
            opts="" ; extra="" ;;
        -region) opts="$(_region ${cur})" ;;
       *) ;;
    esac
    COMPREPLY=( $(compgen -W "${opts}" $extra -- ${cur}) )
}
complete -o filenames -o nospace -F _steadyParticleTracks_ steadyParticleTracks

_stitchMesh_ ()
{
    local cur="${COMP_WORDS[COMP_CWORD]}"
    local prev="${COMP_WORDS[COMP_CWORD-1]}"
    local line=${COMP_LINE}
    local used=$(echo "$line" | grep -oE "\-[a-zA-Z]+ ")

    opts="-case -constant -doc -fields -fileHandler -help -latestTime -libs -mesh -noFunctionObjects -noOverwrite -noZero -overwrite -region -srcDoc -time -tol"
    for o in $used ; do opts="${opts/$o/}" ; done
    extra=""

    [ "$COMP_CWORD" = 1 ] || \
    case "$prev" in
        -case)
            opts="" ; extra="-d" ;;
        -fileHandler)
            opts="uncollated collated masterUncollated" ; extra="" ;;
        -time)
            opts="$(foamListTimes -withZero 2> /dev/null)" ; extra="" ;;
        -libs|-tol)
            opts="" ; extra="" ;;
        -mesh) opts="$(_mesh ${cur})" ;;
        -region) opts="$(_region ${cur})" ;;
       *) ;;
    esac
    COMPREPLY=( $(compgen -W "${opts}" $extra -- ${cur}) )
}
complete -o filenames -o nospace -F _stitchMesh_ stitchMesh

_subsetMesh_ ()
{
    local cur="${COMP_WORDS[COMP_CWORD]}"
    local prev="${COMP_WORDS[COMP_CWORD-1]}"
    local line=${COMP_LINE}
    local used=$(echo "$line" | grep -oE "\-[a-zA-Z]+ ")

    opts="-case -cellSet -cellZone -dict -doc -fileHandler -help -hostRoots -libs -mesh -noFields -noFunctionObjects -noOverwrite -overwrite -parallel -patch -region -resultTime -roots -srcDoc"
    for o in $used ; do opts="${opts/$o/}" ; done
    extra=""

    [ "$COMP_CWORD" = 1 ] || \
    case "$prev" in
        -case)
            opts="" ; extra="-d" ;;
        -dict)
            opts="" ; extra="-d -f" ;;
        -fileHandler)
            opts="uncollated collated masterUncollated" ; extra="" ;;
        -cellSet|-cellZone|-hostRoots|-libs|-patch|-resultTime|-roots)
            opts="" ; extra="" ;;
        -mesh) opts="$(_mesh ${cur})" ;;
        -region) opts="$(_region ${cur})" ;;
       *) ;;
    esac
    COMPREPLY=( $(compgen -W "${opts}" $extra -- ${cur}) )
}
complete -o filenames -o nospace -F _subsetMesh_ subsetMesh

_surfaceAdd_ ()
{
    local cur="${COMP_WORDS[COMP_CWORD]}"
    local prev="${COMP_WORDS[COMP_CWORD-1]}"
    local line=${COMP_LINE}
    local used=$(echo "$line" | grep -oE "\-[a-zA-Z]+ ")

    opts="-doc -help -mergeRegions -points -srcDoc"
    for o in $used ; do opts="${opts/$o/}" ; done
    extra="-d -f"

    [ "$COMP_CWORD" = 1 ] || \
    case "$prev" in
        -points)
            opts="" ; extra="-d -f" ;;
       -*) ;;
        *) opts="";;
    esac
    COMPREPLY=( $(compgen -W "${opts}" $extra -- ${cur}) )
}
complete -o filenames -o nospace -F _surfaceAdd_ surfaceAdd

_surfaceAutoPatch_ ()
{
    local cur="${COMP_WORDS[COMP_CWORD]}"
    local prev="${COMP_WORDS[COMP_CWORD-1]}"
    local line=${COMP_LINE}
    local used=$(echo "$line" | grep -oE "\-[a-zA-Z]+ ")

    opts="-doc -help -srcDoc"
    for o in $used ; do opts="${opts/$o/}" ; done
    extra="-d -f"

    [ "$COMP_CWORD" = 1 ] || \
    case "$prev" in
       -*) ;;
        *)
            opts=""; extra=""
            ;;
    esac
    COMPREPLY=( $(compgen -W "${opts}" $extra -- ${cur}) )
}
complete -o filenames -o nospace -F _surfaceAutoPatch_ surfaceAutoPatch

_surfaceBooleanFeatures_ ()
{
    local cur="${COMP_WORDS[COMP_CWORD]}"
    local prev="${COMP_WORDS[COMP_CWORD-1]}"
    local line=${COMP_LINE}
    local used=$(echo "$line" | grep -oE "\-[a-zA-Z]+ ")

    opts="-case -doc -fileHandler -help -invertedSpace -libs -noFunctionObjects -perturb -srcDoc -surf1Baffle -surf2Baffle"
    for o in $used ; do opts="${opts/$o/}" ; done
    extra="-d -f"

    [ "$COMP_CWORD" = 1 ] || \
    case "$prev" in
        -case)
            opts="" ; extra="-d" ;;
        -fileHandler)
            opts="uncollated collated masterUncollated" ; extra="" ;;
        -libs)
            opts="" ; extra="" ;;
       -*) ;;
        *) opts="";;
    esac
    COMPREPLY=( $(compgen -W "${opts}" $extra -- ${cur}) )
}
complete -o filenames -o nospace -F _surfaceBooleanFeatures_ surfaceBooleanFeatures

_surfaceCheck_ ()
{
    local cur="${COMP_WORDS[COMP_CWORD]}"
    local prev="${COMP_WORDS[COMP_CWORD-1]}"
    local line=${COMP_LINE}
    local used=$(echo "$line" | grep -oE "\-[a-zA-Z]+ ")

    opts="-blockMesh -checkSelfIntersection -doc -help -splitNonManifold -srcDoc -verbose"
    for o in $used ; do opts="${opts/$o/}" ; done
    extra="-d -f"

    [ "$COMP_CWORD" = 1 ] || \
    case "$prev" in
       -*) ;;
        *)
            opts=""; extra=""
            ;;
    esac
    COMPREPLY=( $(compgen -W "${opts}" $extra -- ${cur}) )
}
complete -o filenames -o nospace -F _surfaceCheck_ surfaceCheck

_surfaceClean_ ()
{
    local cur="${COMP_WORDS[COMP_CWORD]}"
    local prev="${COMP_WORDS[COMP_CWORD-1]}"
    local line=${COMP_LINE}
    local used=$(echo "$line" | grep -oE "\-[a-zA-Z]+ ")

    opts="-doc -help -noClean -srcDoc"
    for o in $used ; do opts="${opts/$o/}" ; done
    extra="-d -f"

    [ "$COMP_CWORD" = 1 ] || \
    case "$prev" in
       -*) ;;
        *)
            opts=""; extra=""
            ;;
    esac
    COMPREPLY=( $(compgen -W "${opts}" $extra -- ${cur}) )
}
complete -o filenames -o nospace -F _surfaceClean_ surfaceClean

_surfaceCoarsen_ ()
{
    local cur="${COMP_WORDS[COMP_CWORD]}"
    local prev="${COMP_WORDS[COMP_CWORD-1]}"
    local line=${COMP_LINE}
    local used=$(echo "$line" | grep -oE "\-[a-zA-Z]+ ")

    opts="-doc -help -srcDoc"
    for o in $used ; do opts="${opts/$o/}" ; done
    extra="-d -f"

    [ "$COMP_CWORD" = 1 ] || \
    case "$prev" in
       -*) ;;
        *)
            opts=""; extra=""
            ;;
    esac
    COMPREPLY=( $(compgen -W "${opts}" $extra -- ${cur}) )
}
complete -o filenames -o nospace -F _surfaceCoarsen_ surfaceCoarsen

_surfaceConvert_ ()
{
    local cur="${COMP_WORDS[COMP_CWORD]}"
    local prev="${COMP_WORDS[COMP_CWORD-1]}"
    local line=${COMP_LINE}
    local used=$(echo "$line" | grep -oE "\-[a-zA-Z]+ ")

    opts="-clean -doc -group -help -scale -srcDoc -writePrecision"
    for o in $used ; do opts="${opts/$o/}" ; done
    extra="-d -f"

    [ "$COMP_CWORD" = 1 ] || \
    case "$prev" in
        -scale|-writePrecision)
            opts="" ; extra="" ;;
       -*) ;;
        *)
            case "${COMP_WORDS[COMP_CWORD-2]}" in
                -scale|-writePrecision) ;;
                *) opts=""; extra="" ;;
            esac
            ;;
    esac
    COMPREPLY=( $(compgen -W "${opts}" $extra -- ${cur}) )
}
complete -o filenames -o nospace -F _surfaceConvert_ surfaceConvert

_surfaceFeatureConvert_ ()
{
    local cur="${COMP_WORDS[COMP_CWORD]}"
    local prev="${COMP_WORDS[COMP_CWORD-1]}"
    local line=${COMP_LINE}
    local used=$(echo "$line" | grep -oE "\-[a-zA-Z]+ ")

    opts="-case -doc -fileHandler -help -libs -noFunctionObjects -scale -srcDoc"
    for o in $used ; do opts="${opts/$o/}" ; done
    extra="-d -f"

    [ "$COMP_CWORD" = 1 ] || \
    case "$prev" in
        -case)
            opts="" ; extra="-d" ;;
        -fileHandler)
            opts="uncollated collated masterUncollated" ; extra="" ;;
        -libs|-scale)
            opts="" ; extra="" ;;
       -*) ;;
        *)
            case "${COMP_WORDS[COMP_CWORD-2]}" in
                -libs|-scale|-case|-fileHandler) ;;
                *) opts=""; extra="" ;;
            esac
            ;;
    esac
    COMPREPLY=( $(compgen -W "${opts}" $extra -- ${cur}) )
}
complete -o filenames -o nospace -F _surfaceFeatureConvert_ surfaceFeatureConvert

_surfaceFeatures_ ()
{
    local cur="${COMP_WORDS[COMP_CWORD]}"
    local prev="${COMP_WORDS[COMP_CWORD-1]}"
    local line=${COMP_LINE}
    local used=$(echo "$line" | grep -oE "\-[a-zA-Z]+ ")

    opts="-case -dict -doc -fileHandler -help -libs -noFunctionObjects -srcDoc"
    for o in $used ; do opts="${opts/$o/}" ; done
    extra=""

    [ "$COMP_CWORD" = 1 ] || \
    case "$prev" in
        -case)
            opts="" ; extra="-d" ;;
        -dict)
            opts="" ; extra="-d -f" ;;
        -fileHandler)
            opts="uncollated collated masterUncollated" ; extra="" ;;
        -libs)
            opts="" ; extra="" ;;
       *) ;;
    esac
    COMPREPLY=( $(compgen -W "${opts}" $extra -- ${cur}) )
}
complete -o filenames -o nospace -F _surfaceFeatures_ surfaceFeatures

_surfaceFind_ ()
{
    local cur="${COMP_WORDS[COMP_CWORD]}"
    local prev="${COMP_WORDS[COMP_CWORD-1]}"
    local line=${COMP_LINE}
    local used=$(echo "$line" | grep -oE "\-[a-zA-Z]+ ")

    opts="-doc -help -srcDoc -x -y -z"
    for o in $used ; do opts="${opts/$o/}" ; done
    extra="-d -f"

    [ "$COMP_CWORD" = 1 ] || \
    case "$prev" in
        -x|-y|-z)
            opts="" ; extra="" ;;
       -*) ;;
        *)
            case "${COMP_WORDS[COMP_CWORD-2]}" in
                -x|-y|-z) ;;
                *) opts=""; extra="" ;;
            esac
            ;;
    esac
    COMPREPLY=( $(compgen -W "${opts}" $extra -- ${cur}) )
}
complete -o filenames -o nospace -F _surfaceFind_ surfaceFind

_surfaceHookUp_ ()
{
    local cur="${COMP_WORDS[COMP_CWORD]}"
    local prev="${COMP_WORDS[COMP_CWORD-1]}"
    local line=${COMP_LINE}
    local used=$(echo "$line" | grep -oE "\-[a-zA-Z]+ ")

    opts="-case -dict -doc -fileHandler -help -libs -noFunctionObjects -srcDoc"
    for o in $used ; do opts="${opts/$o/}" ; done
    extra=""

    [ "$COMP_CWORD" = 1 ] || \
    case "$prev" in
        -case)
            opts="" ; extra="-d" ;;
        -dict)
            opts="" ; extra="-d -f" ;;
        -fileHandler)
            opts="uncollated collated masterUncollated" ; extra="" ;;
        -libs)
            opts="" ; extra="" ;;
       *) ;;
    esac
    COMPREPLY=( $(compgen -W "${opts}" $extra -- ${cur}) )
}
complete -o filenames -o nospace -F _surfaceHookUp_ surfaceHookUp

_surfaceInertia_ ()
{
    local cur="${COMP_WORDS[COMP_CWORD]}"
    local prev="${COMP_WORDS[COMP_CWORD-1]}"
    local line=${COMP_LINE}
    local used=$(echo "$line" | grep -oE "\-[a-zA-Z]+ ")

    opts="-density -doc -help -referencePoint -shellProperties -srcDoc"
    for o in $used ; do opts="${opts/$o/}" ; done
    extra="-d -f"

    [ "$COMP_CWORD" = 1 ] || \
    case "$prev" in
        -density|-referencePoint)
            opts="" ; extra="" ;;
       -*) ;;
        *)
            case "${COMP_WORDS[COMP_CWORD-2]}" in
                -density|-referencePoint) ;;
                *) opts=""; extra="" ;;
            esac
            ;;
    esac
    COMPREPLY=( $(compgen -W "${opts}" $extra -- ${cur}) )
}
complete -o filenames -o nospace -F _surfaceInertia_ surfaceInertia

_surfaceLambdaMuSmooth_ ()
{
    local cur="${COMP_WORDS[COMP_CWORD]}"
    local prev="${COMP_WORDS[COMP_CWORD-1]}"
    local line=${COMP_LINE}
    local used=$(echo "$line" | grep -oE "\-[a-zA-Z]+ ")

    opts="-doc -featureFile -help -srcDoc"
    for o in $used ; do opts="${opts/$o/}" ; done
    extra="-d -f"

    [ "$COMP_CWORD" = 1 ] || \
    case "$prev" in
        -featureFile)
            opts="" ; extra="" ;;
       -*) ;;
        *)
            case "${COMP_WORDS[COMP_CWORD-2]}" in
                -featureFile) ;;
                *) opts=""; extra="" ;;
            esac
            ;;
    esac
    COMPREPLY=( $(compgen -W "${opts}" $extra -- ${cur}) )
}
complete -o filenames -o nospace -F _surfaceLambdaMuSmooth_ surfaceLambdaMuSmooth

_surfaceMeshConvert_ ()
{
    local cur="${COMP_WORDS[COMP_CWORD]}"
    local prev="${COMP_WORDS[COMP_CWORD-1]}"
    local line=${COMP_LINE}
    local used=$(echo "$line" | grep -oE "\-[a-zA-Z]+ ")

    opts="-case -clean -doc -fileHandler -from -help -libs -noFunctionObjects -scaleIn -scaleOut -srcDoc -to -tri"
    for o in $used ; do opts="${opts/$o/}" ; done
    extra="-d -f"

    [ "$COMP_CWORD" = 1 ] || \
    case "$prev" in
        -case)
            opts="" ; extra="-d" ;;
        -fileHandler)
            opts="uncollated collated masterUncollated" ; extra="" ;;
        -from|-libs|-scaleIn|-scaleOut|-to)
            opts="" ; extra="" ;;
       -*) ;;
        *)
            case "${COMP_WORDS[COMP_CWORD-2]}" in
                -from|-libs|-scaleIn|-scaleOut|-to|-case|-fileHandler) ;;
                *) opts=""; extra="" ;;
            esac
            ;;
    esac
    COMPREPLY=( $(compgen -W "${opts}" $extra -- ${cur}) )
}
complete -o filenames -o nospace -F _surfaceMeshConvert_ surfaceMeshConvert

_surfaceMeshExport_ ()
{
    local cur="${COMP_WORDS[COMP_CWORD]}"
    local prev="${COMP_WORDS[COMP_CWORD-1]}"
    local line=${COMP_LINE}
    local used=$(echo "$line" | grep -oE "\-[a-zA-Z]+ ")

    opts="-case -clean -doc -fileHandler -from -help -libs -name -noFunctionObjects -scaleIn -scaleOut -srcDoc -to"
    for o in $used ; do opts="${opts/$o/}" ; done
    extra=""

    [ "$COMP_CWORD" = 1 ] || \
    case "$prev" in
        -case)
            opts="" ; extra="-d" ;;
        -fileHandler)
            opts="uncollated collated masterUncollated" ; extra="" ;;
        -from|-libs|-name|-scaleIn|-scaleOut|-to)
            opts="" ; extra="" ;;
       *) ;;
    esac
    COMPREPLY=( $(compgen -W "${opts}" $extra -- ${cur}) )
}
complete -o filenames -o nospace -F _surfaceMeshExport_ surfaceMeshExport

_surfaceMeshImport_ ()
{
    local cur="${COMP_WORDS[COMP_CWORD]}"
    local prev="${COMP_WORDS[COMP_CWORD-1]}"
    local line=${COMP_LINE}
    local used=$(echo "$line" | grep -oE "\-[a-zA-Z]+ ")

    opts="-case -clean -doc -fileHandler -from -help -libs -name -noFunctionObjects -scaleIn -scaleOut -srcDoc -to"
    for o in $used ; do opts="${opts/$o/}" ; done
    extra="-d -f"

    [ "$COMP_CWORD" = 1 ] || \
    case "$prev" in
        -case)
            opts="" ; extra="-d" ;;
        -fileHandler)
            opts="uncollated collated masterUncollated" ; extra="" ;;
        -from|-libs|-name|-scaleIn|-scaleOut|-to)
            opts="" ; extra="" ;;
       -*) ;;
        *)
            case "${COMP_WORDS[COMP_CWORD-2]}" in
                -from|-libs|-name|-scaleIn|-scaleOut|-to|-case|-fileHandler) ;;
                *) opts=""; extra="" ;;
            esac
            ;;
    esac
    COMPREPLY=( $(compgen -W "${opts}" $extra -- ${cur}) )
}
complete -o filenames -o nospace -F _surfaceMeshImport_ surfaceMeshImport

_surfaceMeshInfo_ ()
{
    local cur="${COMP_WORDS[COMP_CWORD]}"
    local prev="${COMP_WORDS[COMP_CWORD-1]}"
    local line=${COMP_LINE}
    local used=$(echo "$line" | grep -oE "\-[a-zA-Z]+ ")

    opts="-areas -case -doc -fileHandler -help -libs -noFunctionObjects -scale -srcDoc -xml"
    for o in $used ; do opts="${opts/$o/}" ; done
    extra="-d -f"

    [ "$COMP_CWORD" = 1 ] || \
    case "$prev" in
        -case)
            opts="" ; extra="-d" ;;
        -fileHandler)
            opts="uncollated collated masterUncollated" ; extra="" ;;
        -libs|-scale)
            opts="" ; extra="" ;;
       -*) ;;
        *)
            case "${COMP_WORDS[COMP_CWORD-2]}" in
                -libs|-scale|-case|-fileHandler) ;;
                *) opts=""; extra="" ;;
            esac
            ;;
    esac
    COMPREPLY=( $(compgen -W "${opts}" $extra -- ${cur}) )
}
complete -o filenames -o nospace -F _surfaceMeshInfo_ surfaceMeshInfo

_surfaceMeshTriangulate_ ()
{
    local cur="${COMP_WORDS[COMP_CWORD]}"
    local prev="${COMP_WORDS[COMP_CWORD-1]}"
    local line=${COMP_LINE}
    local used=$(echo "$line" | grep -oE "\-[a-zA-Z]+ ")

    opts="-case -doc -excludeProcPatches -faceZones -fileHandler -help -hostRoots -libs -mesh -noFunctionObjects -parallel -patches -region -roots -srcDoc"
    for o in $used ; do opts="${opts/$o/}" ; done
    extra=""

    [ "$COMP_CWORD" = 1 ] || \
    case "$prev" in
        -case)
            opts="" ; extra="-d" ;;
        -fileHandler)
            opts="uncollated collated masterUncollated" ; extra="" ;;
        -faceZones|-hostRoots|-libs|-patches|-roots)
            opts="" ; extra="" ;;
        -mesh) opts="$(_mesh ${cur})" ;;
        -region) opts="$(_region ${cur})" ;;
       *) ;;
    esac
    COMPREPLY=( $(compgen -W "${opts}" $extra -- ${cur}) )
}
complete -o filenames -o nospace -F _surfaceMeshTriangulate_ surfaceMeshTriangulate

_surfaceOrient_ ()
{
    local cur="${COMP_WORDS[COMP_CWORD]}"
    local prev="${COMP_WORDS[COMP_CWORD-1]}"
    local line=${COMP_LINE}
    local used=$(echo "$line" | grep -oE "\-[a-zA-Z]+ ")

    opts="-doc -help -inside -srcDoc -usePierceTest"
    for o in $used ; do opts="${opts/$o/}" ; done
    extra="-d -f"

    [ "$COMP_CWORD" = 1 ] || \
    case "$prev" in
       -*) ;;
        *)
            opts=""; extra=""
            ;;
    esac
    COMPREPLY=( $(compgen -W "${opts}" $extra -- ${cur}) )
}
complete -o filenames -o nospace -F _surfaceOrient_ surfaceOrient

_surfacePointMerge_ ()
{
    local cur="${COMP_WORDS[COMP_CWORD]}"
    local prev="${COMP_WORDS[COMP_CWORD-1]}"
    local line=${COMP_LINE}
    local used=$(echo "$line" | grep -oE "\-[a-zA-Z]+ ")

    opts="-doc -help -srcDoc"
    for o in $used ; do opts="${opts/$o/}" ; done
    extra="-d -f"

    [ "$COMP_CWORD" = 1 ] || \
    case "$prev" in
       -*) ;;
        *)
            opts=""; extra=""
            ;;
    esac
    COMPREPLY=( $(compgen -W "${opts}" $extra -- ${cur}) )
}
complete -o filenames -o nospace -F _surfacePointMerge_ surfacePointMerge

_surfaceRedistributePar_ ()
{
    local cur="${COMP_WORDS[COMP_CWORD]}"
    local prev="${COMP_WORDS[COMP_CWORD-1]}"
    local line=${COMP_LINE}
    local used=$(echo "$line" | grep -oE "\-[a-zA-Z]+ ")

    opts="-case -doc -fileHandler -help -hostRoots -keepNonMapped -libs -noFunctionObjects -parallel -roots -srcDoc"
    for o in $used ; do opts="${opts/$o/}" ; done
    extra="-d -f"

    [ "$COMP_CWORD" = 1 ] || \
    case "$prev" in
        -case)
            opts="" ; extra="-d" ;;
        -fileHandler)
            opts="uncollated collated masterUncollated" ; extra="" ;;
        -hostRoots|-libs|-roots)
            opts="" ; extra="" ;;
       -*) ;;
        *)
            case "${COMP_WORDS[COMP_CWORD-2]}" in
                -hostRoots|-libs|-roots|-case|-fileHandler) ;;
                *) opts=""; extra="" ;;
            esac
            ;;
    esac
    COMPREPLY=( $(compgen -W "${opts}" $extra -- ${cur}) )
}
complete -o filenames -o nospace -F _surfaceRedistributePar_ surfaceRedistributePar

_surfaceRefineRedGreen_ ()
{
    local cur="${COMP_WORDS[COMP_CWORD]}"
    local prev="${COMP_WORDS[COMP_CWORD-1]}"
    local line=${COMP_LINE}
    local used=$(echo "$line" | grep -oE "\-[a-zA-Z]+ ")

    opts="-doc -help -srcDoc"
    for o in $used ; do opts="${opts/$o/}" ; done
    extra="-d -f"

    [ "$COMP_CWORD" = 1 ] || \
    case "$prev" in
       -*) ;;
        *)
            opts=""; extra=""
            ;;
    esac
    COMPREPLY=( $(compgen -W "${opts}" $extra -- ${cur}) )
}
complete -o filenames -o nospace -F _surfaceRefineRedGreen_ surfaceRefineRedGreen

_surfaceSplitByPatch_ ()
{
    local cur="${COMP_WORDS[COMP_CWORD]}"
    local prev="${COMP_WORDS[COMP_CWORD-1]}"
    local line=${COMP_LINE}
    local used=$(echo "$line" | grep -oE "\-[a-zA-Z]+ ")

    opts="-doc -help -srcDoc"
    for o in $used ; do opts="${opts/$o/}" ; done
    extra="-d -f"

    [ "$COMP_CWORD" = 1 ] || \
    case "$prev" in
       -*) ;;
        *)
            opts=""; extra=""
            ;;
    esac
    COMPREPLY=( $(compgen -W "${opts}" $extra -- ${cur}) )
}
complete -o filenames -o nospace -F _surfaceSplitByPatch_ surfaceSplitByPatch

_surfaceSplitByTopology_ ()
{
    local cur="${COMP_WORDS[COMP_CWORD]}"
    local prev="${COMP_WORDS[COMP_CWORD-1]}"
    local line=${COMP_LINE}
    local used=$(echo "$line" | grep -oE "\-[a-zA-Z]+ ")

    opts="-doc -help -srcDoc"
    for o in $used ; do opts="${opts/$o/}" ; done
    extra="-d -f"

    [ "$COMP_CWORD" = 1 ] || \
    case "$prev" in
       -*) ;;
        *)
            opts=""; extra=""
            ;;
    esac
    COMPREPLY=( $(compgen -W "${opts}" $extra -- ${cur}) )
}
complete -o filenames -o nospace -F _surfaceSplitByTopology_ surfaceSplitByTopology

_surfaceSplitNonManifolds_ ()
{
    local cur="${COMP_WORDS[COMP_CWORD]}"
    local prev="${COMP_WORDS[COMP_CWORD-1]}"
    local line=${COMP_LINE}
    local used=$(echo "$line" | grep -oE "\-[a-zA-Z]+ ")

    opts="-debug -doc -help -srcDoc"
    for o in $used ; do opts="${opts/$o/}" ; done
    extra="-d -f"

    [ "$COMP_CWORD" = 1 ] || \
    case "$prev" in
       -*) ;;
        *)
            opts=""; extra=""
            ;;
    esac
    COMPREPLY=( $(compgen -W "${opts}" $extra -- ${cur}) )
}
complete -o filenames -o nospace -F _surfaceSplitNonManifolds_ surfaceSplitNonManifolds

_surfaceSubset_ ()
{
    local cur="${COMP_WORDS[COMP_CWORD]}"
    local prev="${COMP_WORDS[COMP_CWORD-1]}"
    local line=${COMP_LINE}
    local used=$(echo "$line" | grep -oE "\-[a-zA-Z]+ ")

    opts="-doc -help -srcDoc"
    for o in $used ; do opts="${opts/$o/}" ; done
    extra="-d -f"

    [ "$COMP_CWORD" = 1 ] || \
    case "$prev" in
       -*) ;;
        *)
            opts=""; extra=""
            ;;
    esac
    COMPREPLY=( $(compgen -W "${opts}" $extra -- ${cur}) )
}
complete -o filenames -o nospace -F _surfaceSubset_ surfaceSubset

_surfaceToPatch_ ()
{
    local cur="${COMP_WORDS[COMP_CWORD]}"
    local prev="${COMP_WORDS[COMP_CWORD-1]}"
    local line=${COMP_LINE}
    local used=$(echo "$line" | grep -oE "\-[a-zA-Z]+ ")

    opts="-case -doc -faceSet -fileHandler -help -libs -noFunctionObjects -srcDoc -tol"
    for o in $used ; do opts="${opts/$o/}" ; done
    extra="-d -f"

    [ "$COMP_CWORD" = 1 ] || \
    case "$prev" in
        -case)
            opts="" ; extra="-d" ;;
        -fileHandler)
            opts="uncollated collated masterUncollated" ; extra="" ;;
        -faceSet|-libs|-tol)
            opts="" ; extra="" ;;
       -*) ;;
        *)
            case "${COMP_WORDS[COMP_CWORD-2]}" in
                -faceSet|-libs|-tol|-case|-fileHandler) ;;
                *) opts=""; extra="" ;;
            esac
            ;;
    esac
    COMPREPLY=( $(compgen -W "${opts}" $extra -- ${cur}) )
}
complete -o filenames -o nospace -F _surfaceToPatch_ surfaceToPatch

_surfaceTransformPoints_ ()
{
    local cur="${COMP_WORDS[COMP_CWORD]}"
    local prev="${COMP_WORDS[COMP_CWORD-1]}"
    local line=${COMP_LINE}
    local used=$(echo "$line" | grep -oE "\-[a-zA-Z]+ ")

    opts="-doc -help -srcDoc"
    for o in $used ; do opts="${opts/$o/}" ; done
    extra="-d -f"

    [ "$COMP_CWORD" = 1 ] || \
    case "$prev" in
       -*) ;;
        *)
            case "${COMP_WORDS[COMP_CWORD-2]}" in
                *) opts="";     extra="-d -f" ;;
            esac
            ;;
    esac
    COMPREPLY=( $(compgen -W "${opts}" $extra -- ${cur}) )
}
complete -o filenames -o nospace -F _surfaceTransformPoints_ surfaceTransformPoints

_temporalInterpolate_ ()
{
    local cur="${COMP_WORDS[COMP_CWORD]}"
    local prev="${COMP_WORDS[COMP_CWORD-1]}"
    local line=${COMP_LINE}
    local used=$(echo "$line" | grep -oE "\-[a-zA-Z]+ ")

    opts="-case -constant -divisions -doc -fields -fileHandler -help -hostRoots -interpolationType -latestTime -libs -noFunctionObjects -noZero -parallel -region -roots -srcDoc -time"
    for o in $used ; do opts="${opts/$o/}" ; done
    extra=""

    [ "$COMP_CWORD" = 1 ] || \
    case "$prev" in
        -case)
            opts="" ; extra="-d" ;;
        -fileHandler)
            opts="uncollated collated masterUncollated" ; extra="" ;;
        -time)
            opts="$(foamListTimes -withZero 2> /dev/null)" ; extra="" ;;
        -divisions|-fields|-hostRoots|-interpolationType|-libs|-roots)
            opts="" ; extra="" ;;
        -region) opts="$(_region ${cur})" ;;
       *) ;;
    esac
    COMPREPLY=( $(compgen -W "${opts}" $extra -- ${cur}) )
}
complete -o filenames -o nospace -F _temporalInterpolate_ temporalInterpolate

_tetgenToFoam_ ()
{
    local cur="${COMP_WORDS[COMP_CWORD]}"
    local prev="${COMP_WORDS[COMP_CWORD-1]}"
    local line=${COMP_LINE}
    local used=$(echo "$line" | grep -oE "\-[a-zA-Z]+ ")

    opts="-case -doc -fileHandler -help -hostRoots -libs -noFaceFile -noFunctionObjects -parallel -roots -srcDoc"
    for o in $used ; do opts="${opts/$o/}" ; done
    extra=""

    [ "$COMP_CWORD" = 1 ] || \
    case "$prev" in
        -case)
            opts="" ; extra="-d" ;;
        -fileHandler)
            opts="uncollated collated masterUncollated" ; extra="" ;;
        -hostRoots|-libs|-roots)
            opts="" ; extra="" ;;
       *) ;;
    esac
    COMPREPLY=( $(compgen -W "${opts}" $extra -- ${cur}) )
}
complete -o filenames -o nospace -F _tetgenToFoam_ tetgenToFoam

_topoSet_ ()
{
    local cur="${COMP_WORDS[COMP_CWORD]}"
    local prev="${COMP_WORDS[COMP_CWORD-1]}"
    local line=${COMP_LINE}
    local used=$(echo "$line" | grep -oE "\-[a-zA-Z]+ ")

    opts="-case -constant -dict -doc -fileHandler -help -hostRoots -latestTime -libs -mesh -noFunctionObjects -noSync -noZero -parallel -region -roots -srcDoc -time"
    for o in $used ; do opts="${opts/$o/}" ; done
    extra=""

    [ "$COMP_CWORD" = 1 ] || \
    case "$prev" in
        -case)
            opts="" ; extra="-d" ;;
        -dict)
            opts="" ; extra="-d -f" ;;
        -fileHandler)
            opts="uncollated collated masterUncollated" ; extra="" ;;
        -time)
            opts="$(foamListTimes -withZero 2> /dev/null)" ; extra="" ;;
        -hostRoots|-libs|-roots)
            opts="" ; extra="" ;;
        -mesh) opts="$(_mesh ${cur})" ;;
        -region) opts="$(_region ${cur})" ;;
       *) ;;
    esac
    COMPREPLY=( $(compgen -W "${opts}" $extra -- ${cur}) )
}
complete -o filenames -o nospace -F _topoSet_ topoSet

_transformPoints_ ()
{
    local cur="${COMP_WORDS[COMP_CWORD]}"
    local prev="${COMP_WORDS[COMP_CWORD-1]}"
    local line=${COMP_LINE}
    local used=$(echo "$line" | grep -oE "\-[a-zA-Z]+ ")

    opts="-allRegions -case -doc -fileHandler -help -hostRoots -libs -mesh -noFunctionObjects -parallel -pointSet -pointZone -region -roots -rotateFields -srcDoc"
    for o in $used ; do opts="${opts/$o/}" ; done
    extra=""

    [ "$COMP_CWORD" = 1 ] || \
    case "$prev" in
        -case)
            opts="" ; extra="-d" ;;
        -fileHandler)
            opts="uncollated collated masterUncollated" ; extra="" ;;
        -hostRoots|-libs|-pointSet|-pointZone|-roots)
            opts="" ; extra="" ;;
        -mesh) opts="$(_mesh ${cur})" ;;
        -region) opts="$(_region ${cur})" ;;
       *) ;;
    esac
    COMPREPLY=( $(compgen -W "${opts}" $extra -- ${cur}) )
}
complete -o filenames -o nospace -F _transformPoints_ transformPoints

_viewFactorsGen_ ()
{
    local cur="${COMP_WORDS[COMP_CWORD]}"
    local prev="${COMP_WORDS[COMP_CWORD-1]}"
    local line=${COMP_LINE}
    local used=$(echo "$line" | grep -oE "\-[a-zA-Z]+ ")

    opts="-case -doc -fileHandler -help -hostRoots -libs -mesh -noFunctionObjects -parallel -region -roots -srcDoc"
    for o in $used ; do opts="${opts/$o/}" ; done
    extra=""

    [ "$COMP_CWORD" = 1 ] || \
    case "$prev" in
        -case)
            opts="" ; extra="-d" ;;
        -fileHandler)
            opts="uncollated collated masterUncollated" ; extra="" ;;
        -hostRoots|-libs|-roots)
            opts="" ; extra="" ;;
        -mesh) opts="$(_mesh ${cur})" ;;
        -region) opts="$(_region ${cur})" ;;
       *) ;;
    esac
    COMPREPLY=( $(compgen -W "${opts}" $extra -- ${cur}) )
}
complete -o filenames -o nospace -F _viewFactorsGen_ viewFactorsGen

_vtkUnstructuredToFoam_ ()
{
    local cur="${COMP_WORDS[COMP_CWORD]}"
    local prev="${COMP_WORDS[COMP_CWORD-1]}"
    local line=${COMP_LINE}
    local used=$(echo "$line" | grep -oE "\-[a-zA-Z]+ ")

    opts="-case -doc -fileHandler -help -libs -noFunctionObjects -srcDoc"
    for o in $used ; do opts="${opts/$o/}" ; done
    extra="-d -f"

    [ "$COMP_CWORD" = 1 ] || \
    case "$prev" in
        -case)
            opts="" ; extra="-d" ;;
        -fileHandler)
            opts="uncollated collated masterUncollated" ; extra="" ;;
        -libs)
            opts="" ; extra="" ;;
       -*) ;;
        *)
            case "${COMP_WORDS[COMP_CWORD-2]}" in
                -libs|-case|-fileHandler) ;;
                *) opts=""; extra="" ;;
            esac
            ;;
    esac
    COMPREPLY=( $(compgen -W "${opts}" $extra -- ${cur}) )
}
complete -o filenames -o nospace -F _vtkUnstructuredToFoam_ vtkUnstructuredToFoam

_writeMeshObj_ ()
{
    local cur="${COMP_WORDS[COMP_CWORD]}"
    local prev="${COMP_WORDS[COMP_CWORD-1]}"
    local line=${COMP_LINE}
    local used=$(echo "$line" | grep -oE "\-[a-zA-Z]+ ")

    opts="-case -cell -cellSet -constant -doc -face -faceSet -fileHandler -help -hostRoots -latestTime -libs -mesh -noFunctionObjects -noZero -parallel -patchEdges -patchFaces -point -region -roots -srcDoc -time"
    for o in $used ; do opts="${opts/$o/}" ; done
    extra=""

    [ "$COMP_CWORD" = 1 ] || \
    case "$prev" in
        -case)
            opts="" ; extra="-d" ;;
        -fileHandler)
            opts="uncollated collated masterUncollated" ; extra="" ;;
        -time)
            opts="$(foamListTimes -withZero 2> /dev/null)" ; extra="" ;;
        -cell|-cellSet|-face|-faceSet|-hostRoots|-libs|-point|-roots)
            opts="" ; extra="" ;;
        -mesh) opts="$(_mesh ${cur})" ;;
        -region) opts="$(_region ${cur})" ;;
       *) ;;
    esac
    COMPREPLY=( $(compgen -W "${opts}" $extra -- ${cur}) )
}
complete -o filenames -o nospace -F _writeMeshObj_ writeMeshObj

_zeroDimensionalMesh_ ()
{
    local cur="${COMP_WORDS[COMP_CWORD]}"
    local prev="${COMP_WORDS[COMP_CWORD-1]}"
    local line=${COMP_LINE}
    local used=$(echo "$line" | grep -oE "\-[a-zA-Z]+ ")

    opts="-case -doc -fileHandler -help -libs -noFunctionObjects -srcDoc"
    for o in $used ; do opts="${opts/$o/}" ; done
    extra=""

    [ "$COMP_CWORD" = 1 ] || \
    case "$prev" in
        -case)
            opts="" ; extra="-d" ;;
        -fileHandler)
            opts="uncollated collated masterUncollated" ; extra="" ;;
        -libs)
            opts="" ; extra="" ;;
       *) ;;
    esac
    COMPREPLY=( $(compgen -W "${opts}" $extra -- ${cur}) )
}
complete -o filenames -o nospace -F _zeroDimensionalMesh_ zeroDimensionalMesh

_zipUpMesh_ ()
{
    local cur="${COMP_WORDS[COMP_CWORD]}"
    local prev="${COMP_WORDS[COMP_CWORD-1]}"
    local line=${COMP_LINE}
    local used=$(echo "$line" | grep -oE "\-[a-zA-Z]+ ")

    opts="-case -doc -fileHandler -help -hostRoots -libs -mesh -noFunctionObjects -parallel -region -roots -srcDoc"
    for o in $used ; do opts="${opts/$o/}" ; done
    extra=""

    [ "$COMP_CWORD" = 1 ] || \
    case "$prev" in
        -case)
            opts="" ; extra="-d" ;;
        -fileHandler)
            opts="uncollated collated masterUncollated" ; extra="" ;;
        -hostRoots|-libs|-roots)
            opts="" ; extra="" ;;
        -mesh) opts="$(_mesh ${cur})" ;;
        -region) opts="$(_region ${cur})" ;;
       *) ;;
    esac
    COMPREPLY=( $(compgen -W "${opts}" $extra -- ${cur}) )
}
complete -o filenames -o nospace -F _zipUpMesh_ zipUpMesh

_buoyantFoam_ ()
{
    local cur="${COMP_WORDS[COMP_CWORD]}"
    local prev="${COMP_WORDS[COMP_CWORD-1]}"
    local line=${COMP_LINE}
    local used=$(echo "$line" | grep -oE "\-[a-zA-Z]+ ")

    opts="-case -doc -fileHandler -help -hostRoots -libs -noFunctionObjects -parallel -roots -srcDoc"
    for o in $used ; do opts="${opts/$o/}" ; done
    extra=""

    [ "$COMP_CWORD" = 1 ] || \
    case "$prev" in
        -case)
            opts="" ; extra="-d" ;;
        -fileHandler)
            opts="uncollated collated masterUncollated" ; extra="" ;;
        -hostRoots|-libs|-roots)
            opts="" ; extra="" ;;
       *) ;;
    esac
    COMPREPLY=( $(compgen -W "${opts}" $extra -- ${cur}) )
}
complete -o filenames -o nospace -F _buoyantFoam_ buoyantFoam

_buoyantReactingFoam_ ()
{
    local cur="${COMP_WORDS[COMP_CWORD]}"
    local prev="${COMP_WORDS[COMP_CWORD-1]}"
    local line=${COMP_LINE}
    local used=$(echo "$line" | grep -oE "\-[a-zA-Z]+ ")

    opts="-case -doc -fileHandler -help -hostRoots -libs -noFunctionObjects -parallel -roots -srcDoc"
    for o in $used ; do opts="${opts/$o/}" ; done
    extra=""

    [ "$COMP_CWORD" = 1 ] || \
    case "$prev" in
        -case)
            opts="" ; extra="-d" ;;
        -fileHandler)
            opts="uncollated collated masterUncollated" ; extra="" ;;
        -hostRoots|-libs|-roots)
            opts="" ; extra="" ;;
       *) ;;
    esac
    COMPREPLY=( $(compgen -W "${opts}" $extra -- ${cur}) )
}
complete -o filenames -o nospace -F _buoyantReactingFoam_ buoyantReactingFoam

_chtMultiRegionFoam_ ()
{
    local cur="${COMP_WORDS[COMP_CWORD]}"
    local prev="${COMP_WORDS[COMP_CWORD-1]}"
    local line=${COMP_LINE}
    local used=$(echo "$line" | grep -oE "\-[a-zA-Z]+ ")

    opts="-case -doc -fileHandler -help -hostRoots -libs -noFunctionObjects -parallel -roots -srcDoc"
    for o in $used ; do opts="${opts/$o/}" ; done
    extra=""

    [ "$COMP_CWORD" = 1 ] || \
    case "$prev" in
        -case)
            opts="" ; extra="-d" ;;
        -fileHandler)
            opts="uncollated collated masterUncollated" ; extra="" ;;
        -hostRoots|-libs|-roots)
            opts="" ; extra="" ;;
       *) ;;
    esac
    COMPREPLY=( $(compgen -W "${opts}" $extra -- ${cur}) )
}
complete -o filenames -o nospace -F _chtMultiRegionFoam_ chtMultiRegionFoam

_compressibleInterFoam_ ()
{
    local cur="${COMP_WORDS[COMP_CWORD]}"
    local prev="${COMP_WORDS[COMP_CWORD-1]}"
    local line=${COMP_LINE}
    local used=$(echo "$line" | grep -oE "\-[a-zA-Z]+ ")

    opts="-case -doc -fileHandler -help -hostRoots -libs -noFunctionObjects -parallel -roots -srcDoc"
    for o in $used ; do opts="${opts/$o/}" ; done
    extra=""

    [ "$COMP_CWORD" = 1 ] || \
    case "$prev" in
        -case)
            opts="" ; extra="-d" ;;
        -fileHandler)
            opts="uncollated collated masterUncollated" ; extra="" ;;
        -hostRoots|-libs|-roots)
            opts="" ; extra="" ;;
       *) ;;
    esac
    COMPREPLY=( $(compgen -W "${opts}" $extra -- ${cur}) )
}
complete -o filenames -o nospace -F _compressibleInterFoam_ compressibleInterFoam

_compressibleMultiphaseInterFoam_ ()
{
    local cur="${COMP_WORDS[COMP_CWORD]}"
    local prev="${COMP_WORDS[COMP_CWORD-1]}"
    local line=${COMP_LINE}
    local used=$(echo "$line" | grep -oE "\-[a-zA-Z]+ ")

    opts="-case -doc -fileHandler -help -hostRoots -libs -noFunctionObjects -parallel -roots -srcDoc"
    for o in $used ; do opts="${opts/$o/}" ; done
    extra=""

    [ "$COMP_CWORD" = 1 ] || \
    case "$prev" in
        -case)
            opts="" ; extra="-d" ;;
        -fileHandler)
            opts="uncollated collated masterUncollated" ; extra="" ;;
        -hostRoots|-libs|-roots)
            opts="" ; extra="" ;;
       *) ;;
    esac
    COMPREPLY=( $(compgen -W "${opts}" $extra -- ${cur}) )
}
complete -o filenames -o nospace -F _compressibleMultiphaseInterFoam_ compressibleMultiphaseInterFoam

_denseParticleFoam_ ()
{
    local cur="${COMP_WORDS[COMP_CWORD]}"
    local prev="${COMP_WORDS[COMP_CWORD-1]}"
    local line=${COMP_LINE}
    local used=$(echo "$line" | grep -oE "\-[a-zA-Z]+ ")

    opts="-case -doc -fileHandler -help -hostRoots -libs -noFunctionObjects -parallel -roots -srcDoc"
    for o in $used ; do opts="${opts/$o/}" ; done
    extra=""

    [ "$COMP_CWORD" = 1 ] || \
    case "$prev" in
        -case)
            opts="" ; extra="-d" ;;
        -fileHandler)
            opts="uncollated collated masterUncollated" ; extra="" ;;
        -hostRoots|-libs|-roots)
            opts="" ; extra="" ;;
       *) ;;
    esac
    COMPREPLY=( $(compgen -W "${opts}" $extra -- ${cur}) )
}
complete -o filenames -o nospace -F _denseParticleFoam_ denseParticleFoam

_driftFluxFoam_ ()
{
    local cur="${COMP_WORDS[COMP_CWORD]}"
    local prev="${COMP_WORDS[COMP_CWORD-1]}"
    local line=${COMP_LINE}
    local used=$(echo "$line" | grep -oE "\-[a-zA-Z]+ ")

    opts="-case -doc -fileHandler -help -hostRoots -libs -noFunctionObjects -parallel -roots -srcDoc"
    for o in $used ; do opts="${opts/$o/}" ; done
    extra=""

    [ "$COMP_CWORD" = 1 ] || \
    case "$prev" in
        -case)
            opts="" ; extra="-d" ;;
        -fileHandler)
            opts="uncollated collated masterUncollated" ; extra="" ;;
        -hostRoots|-libs|-roots)
            opts="" ; extra="" ;;
       *) ;;
    esac
    COMPREPLY=( $(compgen -W "${opts}" $extra -- ${cur}) )
}
complete -o filenames -o nospace -F _driftFluxFoam_ driftFluxFoam

_foamCleanCase_ ()
{
    local cur="${COMP_WORDS[COMP_CWORD]}"
    local prev="${COMP_WORDS[COMP_CWORD-1]}"
    local line=${COMP_LINE}
    local used=$(echo "$line" | grep -oE "\-[a-zA-Z]+ ")

    opts="-case -help"
    for o in $used ; do opts="${opts/$o/}" ; done
    extra=""

    [ "$COMP_CWORD" = 1 ] || \
    case "$prev" in
        -case)
            opts="" ; extra="-d" ;;
       *) ;;
    esac
    COMPREPLY=( $(compgen -W "${opts}" $extra -- ${cur}) )
}
complete -o filenames -o nospace -F _foamCleanCase_ foamCleanCase

_foamCleanPath_ ()
{
    local cur="${COMP_WORDS[COMP_CWORD]}"
    local prev="${COMP_WORDS[COMP_CWORD-1]}"
    local line=${COMP_LINE}
    local used=$(echo "$line" | grep -oE "\-[a-zA-Z]+ ")

    opts="-help"
    for o in $used ; do opts="${opts/$o/}" ; done
    extra=""

    [ "$COMP_CWORD" = 1 ] || \
    case "$prev" in
       *) ;;
    esac
    COMPREPLY=( $(compgen -W "${opts}" $extra -- ${cur}) )
}
complete -o filenames -o nospace -F _foamCleanPath_ foamCleanPath

_foamCleanTutorials_ ()
{
    local cur="${COMP_WORDS[COMP_CWORD]}"
    local prev="${COMP_WORDS[COMP_CWORD-1]}"
    local line=${COMP_LINE}
    local used=$(echo "$line" | grep -oE "\-[a-zA-Z]+ ")

    opts="-help"
    for o in $used ; do opts="${opts/$o/}" ; done
    extra=""

    [ "$COMP_CWORD" = 1 ] || \
    case "$prev" in
       *) ;;
    esac
    COMPREPLY=( $(compgen -W "${opts}" $extra -- ${cur}) )
}
complete -o filenames -o nospace -F _foamCleanTutorials_ foamCleanTutorials

_foamCloneCase_ ()
{
    local cur="${COMP_WORDS[COMP_CWORD]}"
    local prev="${COMP_WORDS[COMP_CWORD-1]}"
    local line=${COMP_LINE}
    local used=$(echo "$line" | grep -oE "\-[a-zA-Z]+ ")

    opts="-add -help -latestTime -no-orig -no-scripts           -processor -startFrom -template"
    for o in $used ; do opts="${opts/$o/}" ; done
    extra="-d"

    [ "$COMP_CWORD" = 1 ] || \
    case "$prev" in
    esac
    COMPREPLY=( $(compgen -W "${opts}" $extra -- ${cur}) )
}
complete -o filenames -o nospace -F _foamCloneCase_ foamCloneCase

_foamCreateVideo_ ()
{
    local cur="${COMP_WORDS[COMP_CWORD]}"
    local prev="${COMP_WORDS[COMP_CWORD-1]}"
    local line=${COMP_LINE}
    local used=$(echo "$line" | grep -oE "\-[a-zA-Z]+ ")

    opts="-begin-pause -dir -end-pause -fps -help -image -out -start -webm"
    for o in $used ; do opts="${opts/$o/}" ; done
    extra=""

    [ "$COMP_CWORD" = 1 ] || \
    case "$prev" in
        -dir)
            opts="" ; extra="-d" ;;
        -begin-pause|-end-pause|-fps|-image|-out|-start)
            opts="" ; extra="" ;;
       *) ;;
    esac
    COMPREPLY=( $(compgen -W "${opts}" $extra -- ${cur}) )
}
complete -o filenames -o nospace -F _foamCreateVideo_ foamCreateVideo

_foamEtcFile_ ()
{
    local cur="${COMP_WORDS[COMP_CWORD]}"
    local prev="${COMP_WORDS[COMP_CWORD-1]}"
    local line=${COMP_LINE}
    local used=$(echo "$line" | grep -oE "\-[a-zA-Z]+ ")

    opts="-all -help -list -mode -prefix -quiet -silent -version"
    for o in $used ; do opts="${opts/$o/}" ; done
    extra=""

    [ "$COMP_CWORD" = 1 ] || \
    case "$prev" in
        -prefix)
            opts="" ; extra="-d" ;;
        -mode|-version)
            opts="" ; extra="" ;;
       *) ;;
    esac
    COMPREPLY=( $(compgen -W "${opts}" $extra -- ${cur}) )
}
complete -o filenames -o nospace -F _foamEtcFile_ foamEtcFile

_foamExec_ ()
{
    local cur="${COMP_WORDS[COMP_CWORD]}"
    local prev="${COMP_WORDS[COMP_CWORD-1]}"
    local line=${COMP_LINE}
    local used=$(echo "$line" | grep -oE "\-[a-zA-Z]+ ")

    opts="-help -prefix -version"
    for o in $used ; do opts="${opts/$o/}" ; done
    extra=""

    [ "$COMP_CWORD" = 1 ] || \
    case "$prev" in
        -prefix)
            opts="" ; extra="-d" ;;
        -version)
            opts="" ; extra="" ;;
       *) ;;
    esac
    COMPREPLY=( $(compgen -W "${opts}" $extra -- ${cur}) )
}
complete -o filenames -o nospace -F _foamExec_ foamExec

_foamFind_ ()
{
    local cur="${COMP_WORDS[COMP_CWORD]}"
    local prev="${COMP_WORDS[COMP_CWORD-1]}"
    local line=${COMP_LINE}
    local used=$(echo "$line" | grep -oE "\-[a-zA-Z]+ ")

    opts="\
        -applications \
        -coded \
        -dir \
        -edit \
        -files \
        -help \
        -isearch \
        -lnInclude \
        -modules \
        -numbers \
        -options \
        -print \
        -search \
        -tutorials"

    for o in $used ; do opts="${opts/$o/}" ; done

    # use only one of '-edit', '-isearch', '-search', '-print'
    local actions="-edit -isearch -search -print"
    _optSet "$used" "$actions" && opts="$(_removeOpts "$opts" "$actions")"

    # use only one of '-applications', '-dir', '-modules', '-tutorials'
    local paths="-applications -dir -modules -tutorials"
    _optSet "$used" "$paths" && opts="$(_removeOpts "$opts" "$paths")"

    local dir=$FOAM_SRC
    echo "$used" | grep -wq "\-applications" && dir=$FOAM_APP
    echo "$line" | grep -wq "\-dir" && \
        dir="$(echo "$line" | grep -ow "\-dir[\t ]*[^ ]*" | cut -d" " -f2)"
    echo "$used" | grep -wq "\-modules" && dir=$FOAM_MODULES
    echo "$used" | grep -wq "\-tutorials" && dir=$FOAM_TUTORIALS

    echo "$line" | grep -wq "[^ ]*.[CHL]" || opts="$opts $(_findArgs "$dir")"
    extra=""

    [ "$COMP_CWORD" = 1 ] || \
    case "$prev" in
        -coded)
            opts="" ; extra="-d -f" ;;
        -dir)
            opts="" ; extra="-d" ;;
       *) ;;
    esac
    COMPREPLY=( $(compgen -W "${opts}" $extra -- ${cur}) )
}
complete -o filenames -o nospace -F _foamFind_ foamFind

_foamGet_ ()
{
    local cur="${COMP_WORDS[COMP_CWORD]}"
    local prev="${COMP_WORDS[COMP_CWORD-1]}"
    local line=${COMP_LINE}
    local used=$(echo "$line" | grep -oE "\-[a-zA-Z]+ ")

    _searchDirs () {
        _dirs="\
            ${HOME}/.OpenFOAM/$WM_PROJECT_VERSION \
            ${HOME}/.OpenFOAM"
        [ -n "$WM_PROJECT_SITE" ] && _dirs=" \
                $WM_PROJECT_SITE/$WM_PROJECT_VERSION/etc \
                $WM_PROJECT_SITE/etc"
        _dirs+=" \
            $WM_PROJECT_INST_DIR/site/$WM_PROJECT_VERSION/etc \
            $WM_PROJECT_INST_DIR/site/etc \
            $FOAM_ETC/caseDicts"

        _files=""
        for _d in $_dirs
        do
            [ -d "$_d" ] && \
                _files="$_files $(find "$_d" -type f ! -name "*.*" -exec basename {} \;)"
        done
        echo "${_files}" | xargs -n 1 | sort -u
    }

    opts="-case -ext -help -no-ext -target -region"
    for o in $used ; do opts="${opts/$o/}" ; done
    extra=""
    opts="${opts} $(_searchDirs)"

    [ "$COMP_CWORD" = 1 ] || \
    case "$prev" in
        -case|-target)
            opts="" ; extra="-d" ;;
        -ext)
            opts="" ; extra="" ;;
        -region)
            opts="$(_region)"; extra="" ;;
       -*) ;;
        *)
            case "${COMP_WORDS[COMP_CWORD-2]}" in
                -case|-ext|-target|-region) ;;
                *) opts=""; extra="" ;;
            esac
            ;;
    esac
    COMPREPLY=( $(compgen -W "${opts}" $extra -- ${cur}) )
}
complete -o filenames -o nospace -F _foamGet_ foamGet

_foamInfo_ ()
{
    local cur="${COMP_WORDS[COMP_CWORD]}"
    local prev="${COMP_WORDS[COMP_CWORD-1]}"
    local line=${COMP_LINE}
    local used=$(echo "$line" | grep -oE "\-[a-zA-Z]+ ")

    opts="-all -browser -help -keyword -web"
    for o in $used ; do opts="${opts/$o/}" ; done
    opts="$opts $(_infoArgs) $(ls $FOAM_APPBIN)"
    extra=""

    [ "$COMP_CWORD" = 1 ] || \
    case "$prev" in
        -browser)
            opts="" ; extra="" ;;
       *) ;;
    esac
    COMPREPLY=( $(compgen -W "${opts}" $extra -- ${cur}) )
}
complete -o filenames -o nospace -F _foamInfo_ foamInfo

_foamJob_ ()
{
    local cur="${COMP_WORDS[COMP_CWORD]}"
    local prev="${COMP_WORDS[COMP_CWORD-1]}"
    local line=${COMP_LINE}
    local used=$(echo "$line" | grep -oE "\-[a-zA-Z]+ ")

    opts="-append -case -help -parallel -screen -version -wait"
    for o in $used ; do opts="${opts/$o/}" ; done
    extra=""

    [ "$COMP_CWORD" = 1 ] || \
    case "$prev" in
        -case)
            opts="" ; extra="-d" ;;
        -version)
            opts="" ; extra="" ;;
       *) ;;
    esac
    COMPREPLY=( $(compgen -W "${opts}" $extra -- ${cur}) )
}
complete -o filenames -o nospace -F _foamJob_ foamJob

_foamLog_ ()
{
    local cur="${COMP_WORDS[COMP_CWORD]}"
    local prev="${COMP_WORDS[COMP_CWORD-1]}"
    local line=${COMP_LINE}
    local used=$(echo "$line" | grep -oE "\-[a-zA-Z]+ ")

    opts="-help -list -localDB -n -quiet"
    for o in $used ; do opts="${opts/$o/}" ; done
    extra="-d -f"

    [ "$COMP_CWORD" = 1 ] || \
    case "$prev" in
       -*) ;;
        *)
            opts=""; extra=""
            ;;
    esac
    COMPREPLY=( $(compgen -W "${opts}" $extra -- ${cur}) )
}
complete -o filenames -o nospace -F _foamLog_ foamLog

_foamMonitor_ ()
{
    local cur="${COMP_WORDS[COMP_CWORD]}"
    local prev="${COMP_WORDS[COMP_CWORD-1]}"
    local line=${COMP_LINE}
    local used=$(echo "$line" | grep -oE "\-[a-zA-Z]+ ")

    opts="-ascii -columns -flip -help -logscale -once -refresh -size -title -yrange"
    for o in $used ; do opts="${opts/$o/}" ; done
    extra="-d -f"

    [ "$COMP_CWORD" = 1 ] || \
    case "$prev" in
        -columns|-refresh|-size|-title|-yrange)
            opts="" ; extra="" ;;
       -*) ;;
        *)
            case "${COMP_WORDS[COMP_CWORD-2]}" in
                -columns|-refresh|-size|-title|-yrange) ;;
                *) opts=""; extra="" ;;
            esac
            ;;
    esac
    COMPREPLY=( $(compgen -W "${opts}" $extra -- ${cur}) )
}
complete -o filenames -o nospace -F _foamMonitor_ foamMonitor

_foamNew_ ()
{
    local cur="${COMP_WORDS[COMP_CWORD]}"
    local prev="${COMP_WORDS[COMP_CWORD-1]}"
    local line=${COMP_LINE}
    local used=$(echo "$line" | grep -oE "\-[a-zA-Z]+ ")

    opts="-help -source -template"
    for o in $used ; do opts="${opts/$o/}" ; done
    extra=""

    [ "$COMP_CWORD" = 1 ] || \
    case "$prev" in
        -source|-template)
            opts="" ; extra="" ;;
       *) ;;
    esac
    COMPREPLY=( $(compgen -W "${opts}" $extra -- ${cur}) )
}
complete -o filenames -o nospace -F _foamNew_ foamNew

_foamNewApp_ ()
{
    local cur="${COMP_WORDS[COMP_CWORD]}"
    local prev="${COMP_WORDS[COMP_CWORD-1]}"
    local line=${COMP_LINE}
    local used=$(echo "$line" | grep -oE "\-[a-zA-Z]+ ")

    opts="-help -plain"
    for o in $used ; do opts="${opts/$o/}" ; done
    extra=""

    [ "$COMP_CWORD" = 1 ] || \
    case "$prev" in
       *) ;;
    esac
    COMPREPLY=( $(compgen -W "${opts}" $extra -- ${cur}) )
}
complete -o filenames -o nospace -F _foamNewApp_ foamNewApp

_foamNewBC_ ()
{
    local cur="${COMP_WORDS[COMP_CWORD]}"
    local prev="${COMP_WORDS[COMP_CWORD-1]}"
    local line=${COMP_LINE}
    local used=$(echo "$line" | grep -oE "\-[a-zA-Z]+ ")

    opts="-help"
    for o in $used ; do opts="${opts/$o/}" ; done
    extra=""

    [ "$COMP_CWORD" = 1 ] || \
    case "$prev" in
       *) ;;
    esac
    COMPREPLY=( $(compgen -W "${opts}" $extra -- ${cur}) )
}
complete -o filenames -o nospace -F _foamNewBC_ foamNewBC

_foamNewFunctionObject_ ()
{
    local cur="${COMP_WORDS[COMP_CWORD]}"
    local prev="${COMP_WORDS[COMP_CWORD-1]}"
    local line=${COMP_LINE}
    local used=$(echo "$line" | grep -oE "\-[a-zA-Z]+ ")

    opts="-help"
    for o in $used ; do opts="${opts/$o/}" ; done
    extra=""

    [ "$COMP_CWORD" = 1 ] || \
    case "$prev" in
       *) ;;
    esac
    COMPREPLY=( $(compgen -W "${opts}" $extra -- ${cur}) )
}
complete -o filenames -o nospace -F _foamNewFunctionObject_ foamNewFunctionObject

_foamRunTutorials_ ()
{
    local cur="${COMP_WORDS[COMP_CWORD]}"
    local prev="${COMP_WORDS[COMP_CWORD-1]}"
    local line=${COMP_LINE}
    local used=$(echo "$line" | grep -oE "\-[a-zA-Z]+ ")

    opts="-help -skipFirst -test"
    for o in $used ; do opts="${opts/$o/}" ; done
    extra=""

    [ "$COMP_CWORD" = 1 ] || \
    case "$prev" in
       *) ;;
    esac
    COMPREPLY=( $(compgen -W "${opts}" $extra -- ${cur}) )
}
complete -o filenames -o nospace -F _foamRunTutorials_ foamRunTutorials

_foamSearch_ ()
{
    local cur="${COMP_WORDS[COMP_CWORD]}"
    local prev="${COMP_WORDS[COMP_CWORD-1]}"
    local line=${COMP_LINE}
    local used=$(echo "$line" | grep -oE "\-[a-zA-Z]+ ")

    opts="-count -help"
    for o in $used ; do opts="${opts/$o/}" ; done
    extra="-d"

    [ "$COMP_CWORD" = 1 ] || \
    case "$prev" in
       -*) ;;
        *)
            opts=""; extra=""
            ;;
    esac
    COMPREPLY=( $(compgen -W "${opts}" $extra -- ${cur}) )
}
complete -o filenames -o nospace -F _foamSearch_ foamSearch

_foamSequenceVTKFiles_ ()
{
    local cur="${COMP_WORDS[COMP_CWORD]}"
    local prev="${COMP_WORDS[COMP_CWORD-1]}"
    local line=${COMP_LINE}
    local used=$(echo "$line" | grep -oE "\-[a-zA-Z]+ ")

    opts="-case -dir -help -out"
    for o in $used ; do opts="${opts/$o/}" ; done
    extra=""

    [ "$COMP_CWORD" = 1 ] || \
    case "$prev" in
        -case|-dir|-out)
            opts="" ; extra="-d" ;;
       *) ;;
    esac
    COMPREPLY=( $(compgen -W "${opts}" $extra -- ${cur}) )
}
complete -o filenames -o nospace -F _foamSequenceVTKFiles_ foamSequenceVTKFiles

_foamTags_ ()
{
    local cur="${COMP_WORDS[COMP_CWORD]}"
    local prev="${COMP_WORDS[COMP_CWORD-1]}"
    local line=${COMP_LINE}
    local used=$(echo "$line" | grep -oE "\-[a-zA-Z]+ ")

    opts="-help"
    for o in $used ; do opts="${opts/$o/}" ; done
    extra=""

    [ "$COMP_CWORD" = 1 ] || \
    case "$prev" in
       *) ;;
    esac
    COMPREPLY=( $(compgen -W "${opts}" $extra -- ${cur}) )
}
complete -o filenames -o nospace -F _foamTags_ foamTags

_foamUnits_ ()
{
    local cur="${COMP_WORDS[COMP_CWORD]}"
    local prev="${COMP_WORDS[COMP_CWORD-1]}"
    local line=${COMP_LINE}
    local used=$(echo "$line" | grep -oE "\-[a-zA-Z]+ ")

    opts="$(_unitArgs "$used")"
    extra=""

    [ "$COMP_CWORD" = 1 ] || \
    case "$prev" in
        -*) ;;
        *) opts="" ;;
    esac
    COMPREPLY=( $(compgen -W "${opts}" $extra -- ${cur}) )
}
complete -o filenames -o nospace -F _foamUnits_ foamUnits

_foamVTKSeries_ ()
{
    local cur="${COMP_WORDS[COMP_CWORD]}"
    local prev="${COMP_WORDS[COMP_CWORD-1]}"
    local line=${COMP_LINE}
    local used=$(echo "$line" | grep -oE "\-[a-zA-Z]+ ")

    opts="-case -dir -help"
    for o in $used ; do opts="${opts/$o/}" ; done
    extra=""

    [ "$COMP_CWORD" = 1 ] || \
    case "$prev" in
        -case|-dir)
            opts="" ; extra="-d" ;;
       *) ;;
    esac
    COMPREPLY=( $(compgen -W "${opts}" $extra -- ${cur}) )
}
complete -o filenames -o nospace -F _foamVTKSeries_ foamVTKSeries

_interFoam_ ()
{
    local cur="${COMP_WORDS[COMP_CWORD]}"
    local prev="${COMP_WORDS[COMP_CWORD-1]}"
    local line=${COMP_LINE}
    local used=$(echo "$line" | grep -oE "\-[a-zA-Z]+ ")

    opts="-case -doc -fileHandler -help -hostRoots -libs -noFunctionObjects -parallel -roots -srcDoc"
    for o in $used ; do opts="${opts/$o/}" ; done
    extra=""

    [ "$COMP_CWORD" = 1 ] || \
    case "$prev" in
        -case)
            opts="" ; extra="-d" ;;
        -fileHandler)
            opts="uncollated collated masterUncollated" ; extra="" ;;
        -hostRoots|-libs|-roots)
            opts="" ; extra="" ;;
       *) ;;
    esac
    COMPREPLY=( $(compgen -W "${opts}" $extra -- ${cur}) )
}
complete -o filenames -o nospace -F _interFoam_ interFoam

_moveDynamicMesh_ ()
{
    local cur="${COMP_WORDS[COMP_CWORD]}"
    local prev="${COMP_WORDS[COMP_CWORD-1]}"
    local line=${COMP_LINE}
    local used=$(echo "$line" | grep -oE "\-[a-zA-Z]+ ")

    opts="-case -doc -fileHandler -help -hostRoots -libs -noFunctionObjects -parallel -roots -srcDoc"
    for o in $used ; do opts="${opts/$o/}" ; done
    extra=""

    [ "$COMP_CWORD" = 1 ] || \
    case "$prev" in
        -case)
            opts="" ; extra="-d" ;;
        -fileHandler)
            opts="uncollated collated masterUncollated" ; extra="" ;;
        -hostRoots|-libs|-roots)
            opts="" ; extra="" ;;
       *) ;;
    esac
    COMPREPLY=( $(compgen -W "${opts}" $extra -- ${cur}) )
}
complete -o filenames -o nospace -F _moveDynamicMesh_ moveDynamicMesh

_moveMesh_ ()
{
    local cur="${COMP_WORDS[COMP_CWORD]}"
    local prev="${COMP_WORDS[COMP_CWORD-1]}"
    local line=${COMP_LINE}
    local used=$(echo "$line" | grep -oE "\-[a-zA-Z]+ ")

    opts="-case -doc -fileHandler -help -hostRoots -libs -noFunctionObjects -parallel -roots -srcDoc"
    for o in $used ; do opts="${opts/$o/}" ; done
    extra=""

    [ "$COMP_CWORD" = 1 ] || \
    case "$prev" in
        -case)
            opts="" ; extra="-d" ;;
        -fileHandler)
            opts="uncollated collated masterUncollated" ; extra="" ;;
        -hostRoots|-libs|-roots)
            opts="" ; extra="" ;;
       *) ;;
    esac
    COMPREPLY=( $(compgen -W "${opts}" $extra -- ${cur}) )
}
complete -o filenames -o nospace -F _moveMesh_ moveMesh

_mpirunDebug_ ()
{
    local cur="${COMP_WORDS[COMP_CWORD]}"
    local prev="${COMP_WORDS[COMP_CWORD-1]}"
    local line=${COMP_LINE}
    local used=$(echo "$line" | grep -oE "\-[a-zA-Z]+ ")

    opts="-help"
    for o in $used ; do opts="${opts/$o/}" ; done
    extra=""

    [ "$COMP_CWORD" = 1 ] || \
    case "$prev" in
       *) ;;
    esac
    COMPREPLY=( $(compgen -W "${opts}" $extra -- ${cur}) )
}
complete -o filenames -o nospace -F _mpirunDebug_ mpirunDebug

_multiphaseEulerFoam_ ()
{
    local cur="${COMP_WORDS[COMP_CWORD]}"
    local prev="${COMP_WORDS[COMP_CWORD-1]}"
    local line=${COMP_LINE}
    local used=$(echo "$line" | grep -oE "\-[a-zA-Z]+ ")

    opts="-case -doc -fileHandler -help -hostRoots -libs -noFunctionObjects -parallel -roots -srcDoc"
    for o in $used ; do opts="${opts/$o/}" ; done
    extra=""

    [ "$COMP_CWORD" = 1 ] || \
    case "$prev" in
        -case)
            opts="" ; extra="-d" ;;
        -fileHandler)
            opts="uncollated collated masterUncollated" ; extra="" ;;
        -hostRoots|-libs|-roots)
            opts="" ; extra="" ;;
       *) ;;
    esac
    COMPREPLY=( $(compgen -W "${opts}" $extra -- ${cur}) )
}
complete -o filenames -o nospace -F _multiphaseEulerFoam_ multiphaseEulerFoam

_multiphaseInterFoam_ ()
{
    local cur="${COMP_WORDS[COMP_CWORD]}"
    local prev="${COMP_WORDS[COMP_CWORD-1]}"
    local line=${COMP_LINE}
    local used=$(echo "$line" | grep -oE "\-[a-zA-Z]+ ")

    opts="-case -doc -fileHandler -help -hostRoots -libs -noFunctionObjects -parallel -roots -srcDoc"
    for o in $used ; do opts="${opts/$o/}" ; done
    extra=""

    [ "$COMP_CWORD" = 1 ] || \
    case "$prev" in
        -case)
            opts="" ; extra="-d" ;;
        -fileHandler)
            opts="uncollated collated masterUncollated" ; extra="" ;;
        -hostRoots|-libs|-roots)
            opts="" ; extra="" ;;
       *) ;;
    esac
    COMPREPLY=( $(compgen -W "${opts}" $extra -- ${cur}) )
}
complete -o filenames -o nospace -F _multiphaseInterFoam_ multiphaseInterFoam

_paraFoam_ ()
{
    local cur="${COMP_WORDS[COMP_CWORD]}"
    local prev="${COMP_WORDS[COMP_CWORD-1]}"
    local line=${COMP_LINE}
    local used=$(echo "$line" | grep -oE "\-[a-zA-Z]+ ")

    opts="-allRegions -block -builtin -case -empty -help -mesh -region -touch -touchAll"
    for o in $used ; do opts="${opts/$o/}" ; done
    extra=""

    [ "$COMP_CWORD" = 1 ] || \
    case "$prev" in
        -case)
            opts="" ; extra="-d" ;;
        -mesh) opts="$(_mesh ${cur})" ;;
        -region) opts="$(_region ${cur})" ;;
       *) ;;
    esac
    COMPREPLY=( $(compgen -W "${opts}" $extra -- ${cur}) )
}
complete -o filenames -o nospace -F _paraFoam_ paraFoam

_paraFoamServer_ ()
{
    local cur="${COMP_WORDS[COMP_CWORD]}"
    local prev="${COMP_WORDS[COMP_CWORD-1]}"
    local line=${COMP_LINE}
    local used=$(echo "$line" | grep -oE "\-[a-zA-Z]+ ")

    opts="-help"
    for o in $used ; do opts="${opts/$o/}" ; done
    extra=""

    [ "$COMP_CWORD" = 1 ] || \
    case "$prev" in
       *) ;;
    esac
    COMPREPLY=( $(compgen -W "${opts}" $extra -- ${cur}) )
}
complete -o filenames -o nospace -F _paraFoamServer_ paraFoamServer

_pimpleFoam_ ()
{
    local cur="${COMP_WORDS[COMP_CWORD]}"
    local prev="${COMP_WORDS[COMP_CWORD-1]}"
    local line=${COMP_LINE}
    local used=$(echo "$line" | grep -oE "\-[a-zA-Z]+ ")

    opts="-case -doc -fileHandler -help -hostRoots -libs -noFunctionObjects -parallel -roots -srcDoc"
    for o in $used ; do opts="${opts/$o/}" ; done
    extra=""

    [ "$COMP_CWORD" = 1 ] || \
    case "$prev" in
        -case)
            opts="" ; extra="-d" ;;
        -fileHandler)
            opts="uncollated collated masterUncollated" ; extra="" ;;
        -hostRoots|-libs|-roots)
            opts="" ; extra="" ;;
       *) ;;
    esac
    COMPREPLY=( $(compgen -W "${opts}" $extra -- ${cur}) )
}
complete -o filenames -o nospace -F _pimpleFoam_ pimpleFoam

_pisoFoam_ ()
{
    local cur="${COMP_WORDS[COMP_CWORD]}"
    local prev="${COMP_WORDS[COMP_CWORD-1]}"
    local line=${COMP_LINE}
    local used=$(echo "$line" | grep -oE "\-[a-zA-Z]+ ")

    opts="-case -doc -fileHandler -help -hostRoots -libs -noFunctionObjects -parallel -roots -srcDoc"
    for o in $used ; do opts="${opts/$o/}" ; done
    extra=""

    [ "$COMP_CWORD" = 1 ] || \
    case "$prev" in
        -case)
            opts="" ; extra="-d" ;;
        -fileHandler)
            opts="uncollated collated masterUncollated" ; extra="" ;;
        -hostRoots|-libs|-roots)
            opts="" ; extra="" ;;
       *) ;;
    esac
    COMPREPLY=( $(compgen -W "${opts}" $extra -- ${cur}) )
}
complete -o filenames -o nospace -F _pisoFoam_ pisoFoam

_postProcess_ ()
{
    local cur="${COMP_WORDS[COMP_CWORD]}"
    local prev="${COMP_WORDS[COMP_CWORD-1]}"
    local line=${COMP_LINE}
    local used=$(echo "$line" | grep -oE "\-[a-zA-Z]+ ")

    opts="-case -constant -dict -doc -field -fields -fileHandler -func -funcs -help -hostRoots -latestTime -libs -list -listTemplates -noFunctionObjects -noZero -parallel -region -roots -srcDoc -time"
    for o in $used ; do opts="${opts/$o/}" ; done
    extra=""

    [ "$COMP_CWORD" = 1 ] || \
    case "$prev" in
        -case)
            opts="" ; extra="-d" ;;
        -dict)
            opts="" ; extra="-d -f" ;;
        -fileHandler)
            opts="uncollated collated masterUncollated" ; extra="" ;;
        -time)
            opts="$(foamListTimes -withZero 2> /dev/null)" ; extra="" ;;
        -field|-fields|-funcs|-hostRoots|-libs|-roots)
            opts="" ; extra="" ;;
        -func) opts="$(_func ${cur})" ;;
        -region) opts="$(_region ${cur})" ;;
       *) ;;
    esac
    COMPREPLY=( $(compgen -W "${opts}" $extra -- ${cur}) )
}
complete -o filenames -o nospace -F _postProcess_ postProcess

_reactingFoam_ ()
{
    local cur="${COMP_WORDS[COMP_CWORD]}"
    local prev="${COMP_WORDS[COMP_CWORD-1]}"
    local line=${COMP_LINE}
    local used=$(echo "$line" | grep -oE "\-[a-zA-Z]+ ")

    opts="-case -doc -fileHandler -help -hostRoots -libs -noFunctionObjects -parallel -roots -srcDoc"
    for o in $used ; do opts="${opts/$o/}" ; done
    extra=""

    [ "$COMP_CWORD" = 1 ] || \
    case "$prev" in
        -case)
            opts="" ; extra="-d" ;;
        -fileHandler)
            opts="uncollated collated masterUncollated" ; extra="" ;;
        -hostRoots|-libs|-roots)
            opts="" ; extra="" ;;
       *) ;;
    esac
    COMPREPLY=( $(compgen -W "${opts}" $extra -- ${cur}) )
}
complete -o filenames -o nospace -F _reactingFoam_ reactingFoam

_rhoCentralFoam_ ()
{
    local cur="${COMP_WORDS[COMP_CWORD]}"
    local prev="${COMP_WORDS[COMP_CWORD-1]}"
    local line=${COMP_LINE}
    local used=$(echo "$line" | grep -oE "\-[a-zA-Z]+ ")

    opts="-case -doc -fileHandler -help -hostRoots -libs -noFunctionObjects -parallel -roots -srcDoc"
    for o in $used ; do opts="${opts/$o/}" ; done
    extra=""

    [ "$COMP_CWORD" = 1 ] || \
    case "$prev" in
        -case)
            opts="" ; extra="-d" ;;
        -fileHandler)
            opts="uncollated collated masterUncollated" ; extra="" ;;
        -hostRoots|-libs|-roots)
            opts="" ; extra="" ;;
       *) ;;
    esac
    COMPREPLY=( $(compgen -W "${opts}" $extra -- ${cur}) )
}
complete -o filenames -o nospace -F _rhoCentralFoam_ rhoCentralFoam

_rhoPimpleFoam_ ()
{
    local cur="${COMP_WORDS[COMP_CWORD]}"
    local prev="${COMP_WORDS[COMP_CWORD-1]}"
    local line=${COMP_LINE}
    local used=$(echo "$line" | grep -oE "\-[a-zA-Z]+ ")

    opts="-case -doc -fileHandler -help -hostRoots -libs -noFunctionObjects -parallel -roots -srcDoc"
    for o in $used ; do opts="${opts/$o/}" ; done
    extra=""

    [ "$COMP_CWORD" = 1 ] || \
    case "$prev" in
        -case)
            opts="" ; extra="-d" ;;
        -fileHandler)
            opts="uncollated collated masterUncollated" ; extra="" ;;
        -hostRoots|-libs|-roots)
            opts="" ; extra="" ;;
       *) ;;
    esac
    COMPREPLY=( $(compgen -W "${opts}" $extra -- ${cur}) )
}
complete -o filenames -o nospace -F _rhoPimpleFoam_ rhoPimpleFoam

_rhoSimpleFoam_ ()
{
    local cur="${COMP_WORDS[COMP_CWORD]}"
    local prev="${COMP_WORDS[COMP_CWORD-1]}"
    local line=${COMP_LINE}
    local used=$(echo "$line" | grep -oE "\-[a-zA-Z]+ ")

    opts="-case -doc -fileHandler -help -hostRoots -libs -noFunctionObjects -parallel -roots -srcDoc"
    for o in $used ; do opts="${opts/$o/}" ; done
    extra=""

    [ "$COMP_CWORD" = 1 ] || \
    case "$prev" in
        -case)
            opts="" ; extra="-d" ;;
        -fileHandler)
            opts="uncollated collated masterUncollated" ; extra="" ;;
        -hostRoots|-libs|-roots)
            opts="" ; extra="" ;;
       *) ;;
    esac
    COMPREPLY=( $(compgen -W "${opts}" $extra -- ${cur}) )
}
complete -o filenames -o nospace -F _rhoSimpleFoam_ rhoSimpleFoam

_simpleFoam_ ()
{
    local cur="${COMP_WORDS[COMP_CWORD]}"
    local prev="${COMP_WORDS[COMP_CWORD-1]}"
    local line=${COMP_LINE}
    local used=$(echo "$line" | grep -oE "\-[a-zA-Z]+ ")

    opts="-case -doc -fileHandler -help -hostRoots -libs -noFunctionObjects -parallel -roots -srcDoc"
    for o in $used ; do opts="${opts/$o/}" ; done
    extra=""

    [ "$COMP_CWORD" = 1 ] || \
    case "$prev" in
        -case)
            opts="" ; extra="-d" ;;
        -fileHandler)
            opts="uncollated collated masterUncollated" ; extra="" ;;
        -hostRoots|-libs|-roots)
            opts="" ; extra="" ;;
       *) ;;
    esac
    COMPREPLY=( $(compgen -W "${opts}" $extra -- ${cur}) )
}
complete -o filenames -o nospace -F _simpleFoam_ simpleFoam

_solidDisplacementFoam_ ()
{
    local cur="${COMP_WORDS[COMP_CWORD]}"
    local prev="${COMP_WORDS[COMP_CWORD-1]}"
    local line=${COMP_LINE}
    local used=$(echo "$line" | grep -oE "\-[a-zA-Z]+ ")

    opts="-case -doc -fileHandler -help -hostRoots -libs -noFunctionObjects -parallel -roots -srcDoc"
    for o in $used ; do opts="${opts/$o/}" ; done
    extra=""

    [ "$COMP_CWORD" = 1 ] || \
    case "$prev" in
        -case)
            opts="" ; extra="-d" ;;
        -fileHandler)
            opts="uncollated collated masterUncollated" ; extra="" ;;
        -hostRoots|-libs|-roots)
            opts="" ; extra="" ;;
       *) ;;
    esac
    COMPREPLY=( $(compgen -W "${opts}" $extra -- ${cur}) )
}
complete -o filenames -o nospace -F _solidDisplacementFoam_ solidDisplacementFoam

_solidEquilibriumDisplacementFoam_ ()
{
    local cur="${COMP_WORDS[COMP_CWORD]}"
    local prev="${COMP_WORDS[COMP_CWORD-1]}"
    local line=${COMP_LINE}
    local used=$(echo "$line" | grep -oE "\-[a-zA-Z]+ ")

    opts="-case -doc -fileHandler -help -hostRoots -libs -noFunctionObjects -parallel -roots -srcDoc"
    for o in $used ; do opts="${opts/$o/}" ; done
    extra=""

    [ "$COMP_CWORD" = 1 ] || \
    case "$prev" in
        -case)
            opts="" ; extra="-d" ;;
        -fileHandler)
            opts="uncollated collated masterUncollated" ; extra="" ;;
        -hostRoots|-libs|-roots)
            opts="" ; extra="" ;;
       *) ;;
    esac
    COMPREPLY=( $(compgen -W "${opts}" $extra -- ${cur}) )
}
complete -o filenames -o nospace -F _solidEquilibriumDisplacementFoam_ solidEquilibriumDisplacementFoam

_XiFoam_ ()
{
    local cur="${COMP_WORDS[COMP_CWORD]}"
    local prev="${COMP_WORDS[COMP_CWORD-1]}"
    local line=${COMP_LINE}
    local used=$(echo "$line" | grep -oE "\-[a-zA-Z]+ ")

    opts="-case -doc -fileHandler -help -hostRoots -libs -noFunctionObjects -parallel -roots -srcDoc"
    for o in $used ; do opts="${opts/$o/}" ; done
    extra=""

    [ "$COMP_CWORD" = 1 ] || \
    case "$prev" in
        -case)
            opts="" ; extra="-d" ;;
        -fileHandler)
            opts="uncollated collated masterUncollated" ; extra="" ;;
        -hostRoots|-libs|-roots)
            opts="" ; extra="" ;;
       *) ;;
    esac
    COMPREPLY=( $(compgen -W "${opts}" $extra -- ${cur}) )
}
complete -o filenames -o nospace -F _XiFoam_ XiFoam

_wclean_ ()
{
    local cur="${COMP_WORDS[COMP_CWORD]}"
    local prev="${COMP_WORDS[COMP_CWORD-1]}"
    local line=${COMP_LINE}
    local used=$(echo "$line" | grep -oE "\-[a-zA-Z]+ ")

    opts="-help -noLnInclude -silent"
    for o in $used ; do opts="${opts/$o/}" ; done
    extra="-d"

    [ "$COMP_CWORD" = 1 ] || \
    case "$prev" in
       -*) ;;
        *)
            opts=""; extra=""
            ;;
    esac
    COMPREPLY=( $(compgen -W "${opts}" $extra -- ${cur}) )
}
complete -o filenames -o nospace -F _wclean_ wclean

_wcleanPlatform_ ()
{
    local cur="${COMP_WORDS[COMP_CWORD]}"
    local prev="${COMP_WORDS[COMP_CWORD-1]}"
    local line=${COMP_LINE}
    local used=$(echo "$line" | grep -oE "\-[a-zA-Z]+ ")

    opts="-all -current -help"
    for o in $used ; do opts="${opts/$o/}" ; done
    extra=""

    [ "$COMP_CWORD" = 1 ] || \
    case "$prev" in
       *) ;;
    esac
    COMPREPLY=( $(compgen -W "${opts}" $extra -- ${cur}) )
}
complete -o filenames -o nospace -F _wcleanPlatform_ wcleanPlatform

_wdep_ ()
{
    local cur="${COMP_WORDS[COMP_CWORD]}"
    local prev="${COMP_WORDS[COMP_CWORD-1]}"
    local line=${COMP_LINE}
    local used=$(echo "$line" | grep -oE "\-[a-zA-Z]+ ")

    opts="-help"
    for o in $used ; do opts="${opts/$o/}" ; done
    extra="-d -f"

    [ "$COMP_CWORD" = 1 ] || \
    case "$prev" in
       -*) ;;
        *)
            opts=""; extra=""
            ;;
    esac
    COMPREPLY=( $(compgen -W "${opts}" $extra -- ${cur}) )
}
complete -o filenames -o nospace -F _wdep_ wdep

_wmake_ ()
{
    local cur="${COMP_WORDS[COMP_CWORD]}"
    local prev="${COMP_WORDS[COMP_CWORD-1]}"
    local line=${COMP_LINE}
    local used=$(echo "$line" | grep -oE "\-[a-zA-Z]+ ")

    opts="-all -help -j -j -non-stop -no-scheduler -queue -silent -update"
    for o in $used ; do opts="${opts/$o/}" ; done
    extra="-d"

    [ "$COMP_CWORD" = 1 ] || \
    case "$prev" in
        -j)
            opts="" ; extra="" ;;
       -*) ;;
        *)
            case "${COMP_WORDS[COMP_CWORD-2]}" in
                -j) ;;
                *) opts=""; extra="" ;;
            esac
            ;;
    esac
    COMPREPLY=( $(compgen -W "${opts}" $extra -- ${cur}) )
}
complete -o filenames -o nospace -F _wmake_ wmake

_wmakeCheckPwd_ ()
{
    local cur="${COMP_WORDS[COMP_CWORD]}"
    local prev="${COMP_WORDS[COMP_CWORD-1]}"
    local line=${COMP_LINE}
    local used=$(echo "$line" | grep -oE "\-[a-zA-Z]+ ")

    opts="-help -quiet"
    for o in $used ; do opts="${opts/$o/}" ; done
    extra="-d"

    [ "$COMP_CWORD" = 1 ] || \
    case "$prev" in
       -*) ;;
        *)
            opts=""; extra=""
            ;;
    esac
    COMPREPLY=( $(compgen -W "${opts}" $extra -- ${cur}) )
}
complete -o filenames -o nospace -F _wmakeCheckPwd_ wmakeCheckPwd

_wmakeCollect_ ()
{
    local cur="${COMP_WORDS[COMP_CWORD]}"
    local prev="${COMP_WORDS[COMP_CWORD-1]}"
    local line=${COMP_LINE}
    local used=$(echo "$line" | grep -oE "\-[a-zA-Z]+ ")

    opts="-clean -help -kill"
    for o in $used ; do opts="${opts/$o/}" ; done
    extra=""

    [ "$COMP_CWORD" = 1 ] || \
    case "$prev" in
       *) ;;
    esac
    COMPREPLY=( $(compgen -W "${opts}" $extra -- ${cur}) )
}
complete -o filenames -o nospace -F _wmakeCollect_ wmakeCollect

_wmakeFilesAndOptions_ ()
{
    local cur="${COMP_WORDS[COMP_CWORD]}"
    local prev="${COMP_WORDS[COMP_CWORD-1]}"
    local line=${COMP_LINE}
    local used=$(echo "$line" | grep -oE "\-[a-zA-Z]+ ")

    opts="-help"
    for o in $used ; do opts="${opts/$o/}" ; done
    extra=""

    [ "$COMP_CWORD" = 1 ] || \
    case "$prev" in
       *) ;;
    esac
    COMPREPLY=( $(compgen -W "${opts}" $extra -- ${cur}) )
}
complete -o filenames -o nospace -F _wmakeFilesAndOptions_ wmakeFilesAndOptions

_wmakeLnInclude_ ()
{
    local cur="${COMP_WORDS[COMP_CWORD]}"
    local prev="${COMP_WORDS[COMP_CWORD-1]}"
    local line=${COMP_LINE}
    local used=$(echo "$line" | grep -oE "\-[a-zA-Z]+ ")

    opts="-help -silent -update"
    for o in $used ; do opts="${opts/$o/}" ; done
    extra="-d"

    [ "$COMP_CWORD" = 1 ] || \
    case "$prev" in
       -*) ;;
        *)
            opts=""; extra=""
            ;;
    esac
    COMPREPLY=( $(compgen -W "${opts}" $extra -- ${cur}) )
}
complete -o filenames -o nospace -F _wmakeLnInclude_ wmakeLnInclude

_wmakeLnIncludeAll_ ()
{
    local cur="${COMP_WORDS[COMP_CWORD]}"
    local prev="${COMP_WORDS[COMP_CWORD-1]}"
    local line=${COMP_LINE}
    local used=$(echo "$line" | grep -oE "\-[a-zA-Z]+ ")

    opts="-help -j -j"
    for o in $used ; do opts="${opts/$o/}" ; done
    extra="-d"

    [ "$COMP_CWORD" = 1 ] || \
    case "$prev" in
        -j)
            opts="" ; extra="" ;;
       -*) ;;
        *)
            case "${COMP_WORDS[COMP_CWORD-2]}" in
                -j) ;;
                *) opts=""; extra="" ;;
            esac
            ;;
    esac
    COMPREPLY=( $(compgen -W "${opts}" $extra -- ${cur}) )
}
complete -o filenames -o nospace -F _wmakeLnIncludeAll_ wmakeLnIncludeAll

_wmakePrintBuild_ ()
{
    local cur="${COMP_WORDS[COMP_CWORD]}"
    local prev="${COMP_WORDS[COMP_CWORD-1]}"
    local line=${COMP_LINE}
    local used=$(echo "$line" | grep -oE "\-[a-zA-Z]+ ")

    opts="-check -help -major -pkg -short -update -version"
    for o in $used ; do opts="${opts/$o/}" ; done
    extra=""

    [ "$COMP_CWORD" = 1 ] || \
    case "$prev" in
        -pkg|-version)
            opts="" ; extra="" ;;
       *) ;;
    esac
    COMPREPLY=( $(compgen -W "${opts}" $extra -- ${cur}) )
}
complete -o filenames -o nospace -F _wmakePrintBuild_ wmakePrintBuild

_wmakeSchedulerUptime_ ()
{
    local cur="${COMP_WORDS[COMP_CWORD]}"
    local prev="${COMP_WORDS[COMP_CWORD-1]}"
    local line=${COMP_LINE}
    local used=$(echo "$line" | grep -oE "\-[a-zA-Z]+ ")

    opts="-help"
    for o in $used ; do opts="${opts/$o/}" ; done
    extra=""

    [ "$COMP_CWORD" = 1 ] || \
    case "$prev" in
       *) ;;
    esac
    COMPREPLY=( $(compgen -W "${opts}" $extra -- ${cur}) )
}
complete -o filenames -o nospace -F _wmakeSchedulerUptime_ wmakeSchedulerUptime

_wrmo_ ()
{
    local cur="${COMP_WORDS[COMP_CWORD]}"
    local prev="${COMP_WORDS[COMP_CWORD-1]}"
    local line=${COMP_LINE}
    local used=$(echo "$line" | grep -oE "\-[a-zA-Z]+ ")

    opts="-all -help"
    for o in $used ; do opts="${opts/$o/}" ; done
    extra="-d -f"

    [ "$COMP_CWORD" = 1 ] || \
    case "$prev" in
       -*) ;;
        *)
            opts=""; extra=""
            ;;
    esac
    COMPREPLY=( $(compgen -W "${opts}" $extra -- ${cur}) )
}
complete -o filenames -o nospace -F _wrmo_ wrmo

#------------------------------------------------------------------------------
